Documentation ¶
Overview ¶
Package client provides a client for interacting with the metadata-api service
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( errors.New("client is unauthorized") // ErrPermissionDenied returned when the request is not authorized ErrPermissionDenied = errors.New("client does not have permission to perform this action") )ErrUnauthorized =
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the metadata api
func (*Client) StatusUpdate ¶
func (c *Client) StatusUpdate(ctx context.Context, input *StatusUpdateInput) (*StatusUpdate, error)
StatusUpdate mutates the requested nodeID with json status
type ErrInvalidID ¶
type ErrInvalidID struct {
// contains filtered or unexported fields
}
ErrInvaliID returned when an invalid id is provided
func (*ErrInvalidID) Error ¶
func (e *ErrInvalidID) Error() string
Error implements the error interface.
type GQLClient ¶
type GQLClient interface { Query(tx context.Context, q interface{}, variables map[string]interface{}, options ...graphql.Option) error Mutate(ctx context.Context, m interface{}, variables map[string]interface{}, options ...graphql.Option) error }
GQLClient is an interface for a graphql client
type Option ¶
type Option func(*Client)
Option is a function that modifies a client
func WithHTTPClient ¶
WithHTTPClient functional option to set the http client
type StatusUpdate ¶
type StatusUpdate struct {
StatusUpdate StatusUpdateResponse `graphql:"statusUpdate(input: $input)"`
}
StatusUpdate is the statusUpdate mutation
type StatusUpdateInput ¶
type StatusUpdateInput struct { // The node ID for this status. NodeID string `graphql:"nodeID" json:"nodeID"` // The namespace ID for this status. NamespaceID string `graphql:"namespaceID" json:"namespaceID"` // The source for this status. Source string `graphql:"source" json:"source"` // The data to save in this status. Data json.RawMessage `graphql:"data" json:"data"` }
StatusUpdateInput is the input for the statusUpdate mutation
type StatusUpdateResponse ¶
type StatusUpdateResponse struct { Status struct { ID string `graphql:"id"` Data json.RawMessage `graphql:"data"` Source string `graphql:"source"` StatusNamespaceID string `graphql:"statusNamespaceID"` Metadata struct { ID string `graphql:"id"` NodeID string `graphql:"nodeID"` } `graphql:"metadata"` } `graphql:"status"` }
StatusUpdateResponse is the response for the statusUpdate mutation
Directories ¶
Path | Synopsis |
---|---|
Package mockmetadata Simplifying testing metadata node status updates in applications.
|
Package mockmetadata Simplifying testing metadata node status updates in applications. |
Click to show internal directories.
Click to hide internal directories.