{"modulePath":"github.com/dispatchrun/dispatch-go","version":"v0.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package dispatchclient\n\n## Types\n\n```go\ntype Batch struct {\n\t// contains filtered or unexported fields\n}\n```\nBatch is used to submit a batch of function calls to Dispatch.\n\n```go\nfunc (b *Batch) Add(calls ...dispatchproto.Call)\n```\nAdd adds calls to the batch.\n\n```go\nfunc (b *Batch) Dispatch(ctx context.Context) ([]dispatchproto.ID, error)\n```\nDispatch dispatches the batch of function calls.\n\n```go\nfunc (b *Batch) Reset()\n```\nReset resets the batch.\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient is a client for the Dispatch API.\n\nThe Client can be used to dispatch function calls.\n\n```go\nfunc New(opts ...Option) (*Client, error)\n```\nNew creates a Client.\n\n```go\nfunc (c *Client) Batch() Batch\n```\nBatch creates a Batch.\n\n```go\nfunc (c *Client) Dispatch(ctx context.Context, call dispatchproto.Call) (dispatchproto.ID, error)\n```\nDispatch dispatches a function call.\n\n```go\ntype Option func(*Client)\n```\nOption configures a Client.\n\n```go\nfunc APIKey(apiKey string) Option\n```\nAPIKey sets the Dispatch API key to use for authentication when dispatching function calls through a Client.\n\nIt defaults to the value of the DISPATCH\\_API\\_KEY environment variable.\n\n```go\nfunc APIUrl(apiUrl string) Option\n```\nAPIUrl sets the URL of the Dispatch API.\n\nIt defaults to the value of the DISPATCH\\_API\\_URL environment variable, or the default API URL ([https://api.dispatch.run](https://api.dispatch.run)) if DISPATCH\\_API\\_URL is unset.\n\n```go\nfunc Env(env ...string) Option\n```\nEnv sets the environment variables that a Client parses its default configuration from.\n\nIt defaults to os.Environ().\n\n","path":"github.com/dispatchrun/dispatch-go/dispatchclient","name":"dispatchclient","synopsis":"","isRedistributable":true}
