(Client)
Client API
- GetConfiguration - Get Agent Configuration
- Authenticate - Authenticate Client
Returns the configuration for the agent.
package main
import(
cipherswarmagentsdkgo "github.com/unclesp1d3r/cipherswarm-agent-sdk-go"
"context"
"log"
)
func main() {
s := cipherswarmagentsdkgo.New(
cipherswarmagentsdkgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
ctx := context.Background()
res, err := s.Client.GetConfiguration(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetConfigurationResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.ErrorObject | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Authenticates the client. This is used to verify that the client is able to connect to the server.
package main
import(
cipherswarmagentsdkgo "github.com/unclesp1d3r/cipherswarm-agent-sdk-go"
"context"
"log"
)
func main() {
s := cipherswarmagentsdkgo.New(
cipherswarmagentsdkgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
ctx := context.Background()
res, err := s.Client.Authenticate(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.AuthenticateResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.ErrorObject | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |