Documentation
¶
Overview ¶
Package client provides a client for the opampcommander API server.
Index ¶
Constants ¶
View Source
const ( // ListAgentURL is the path to list all agents. ListAgentURL = "/api/v1/agents" // GetAgentURL is the path to get an agent by ID. GetAgentURL = "/api/v1/agents/:id" )
View Source
const ( // ListConnectionsPath is the path to list all connections. ListConnectionsPath = "/api/v1/connections" // GetConnectionPath is the path to get a connection by ID. GetConnectionPath = "/api/v1/connections/:id" )
API paths for connection resources.
Variables ¶
View Source
var ( // ErrEmptyResponse is an error that indicates that the response from the server is empty. ErrEmptyResponse = errors.New("empty response") // ErrUnexpectedBehavior is an error that indicates that the server behavior is not as expected. ErrUnexpectedBehavior = errors.New("unexpected behavior") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a struct that contains the endpoint and the resty client.
func (*Client) GetConnection ¶
func (c *Client) GetConnection(id uuid.UUID) (*connectionv1.Connection, error)
GetConnection retrieves a connection by its ID.
func (*Client) ListAgents ¶
ListAgents lists all agents.
func (*Client) ListConnections ¶
func (c *Client) ListConnections() ([]*connectionv1.Connection, error)
ListConnections lists all connections.
type ResponseError ¶
type ResponseError struct {
StatusCode int
}
ResponseError represents an error that occurs when the response from the server is not as expected. It contains the status code of the response.
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
Error implements the error interface for ResponseError.
Click to show internal directories.
Click to hide internal directories.