Documentation
¶
Overview ¶
Package client is the REST client of the graphnest command-line tool.
Index ¶
- type Client
- func (c *Client) GraphStatus(ctx context.Context, id int64) (api.GraphStatus, error)
- func (c *Client) Publish(ctx context.Context, id int64, commit string, expectedGeneration int64, ...) (api.GraphPublicationResult, error)
- func (c *Client) Repository(ctx context.Context, id int64) (api.RepositorySummary, error)
- type Config
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to a GraphNest server with a bearer token.
func (*Client) GraphStatus ¶
GraphStatus fetches GET /v1/graph/repositories/{id}/status.
func (*Client) Publish ¶
func (c *Client) Publish(ctx context.Context, id int64, commit string, expectedGeneration int64, replaceProducer bool, artifact []byte) (api.GraphPublicationResult, error)
Publish uploads a v2 graph artifact.
func (*Client) Repository ¶
Repository fetches GET /v1/repositories/{id}.
type Config ¶
type Config struct {
ServerURL string // GRAPHNEST_SERVER_URL, required, http or https
Token string // GRAPHNEST_TOKEN, or the trimmed contents of the file named by GRAPHNEST_TOKEN_FILE; exactly one must be set
CAPEM []byte // contents of GRAPHNEST_CA_FILE when set
Timeout time.Duration // whole-request timeout; zero means 2 minutes
}
Config comes from the environment only; a token never comes from arguments.