Initial commit: Elydora Go SDK
Go SDK for Elydora agent operations, cryptographic signing, and audit trail integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
8916506ebc
26 files changed
+3381
No files matched your search
@@ -0,0 +1,44 @@
|
||||
package elydora
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// QueryAudit queries the audit log with the given parameters.
|
||||
func (c *Client) QueryAudit(params *AuditQueryRequest) (*AuditQueryResponse, error) {
|
||||
q := url.Values{}
|
||||
if params.OrgID != "" {
|
||||
q.Set("org_id", params.OrgID)
|
||||
}
|
||||
if params.AgentID != "" {
|
||||
q.Set("agent_id", params.AgentID)
|
||||
}
|
||||
if params.OperationType != "" {
|
||||
q.Set("operation_type", params.OperationType)
|
||||
}
|
||||
if params.StartTime != nil {
|
||||
q.Set("start_time", strconv.FormatInt(*params.StartTime, 10))
|
||||
}
|
||||
if params.EndTime != nil {
|
||||
q.Set("end_time", strconv.FormatInt(*params.EndTime, 10))
|
||||
}
|
||||
if params.Cursor != "" {
|
||||
q.Set("cursor", params.Cursor)
|
||||
}
|
||||
if params.Limit != nil {
|
||||
q.Set("limit", strconv.Itoa(*params.Limit))
|
||||
}
|
||||
|
||||
path := "/audit"
|
||||
if encoded := q.Encode(); encoded != "" {
|
||||
path = fmt.Sprintf("/audit?%s", encoded)
|
||||
}
|
||||
|
||||
var result AuditQueryResponse
|
||||
if err := c.doGet(path, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
Reference in new issue
Block a user