{"modulePath":"github.com/dispatchrun/dispatch-go","version":"v0.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package dispatchserver\n\n## Types\n\n```go\ntype EndpointClient struct {\n\t// contains filtered or unexported fields\n}\n```\nEndpointClient is a client for a Dispatch endpoint.\n\nNote that this is not the same as dispatch.Client, which is a client for the Dispatch API. The client here is used by a Dispatch server to interact with the functions provided by a Dispatch endpoint.\n\n```go\nfunc NewEndpointClient(endpointUrl string, opts ...EndpointClientOption) (*EndpointClient, error)\n```\nNewEndpointClient creates an EndpointClient.\n\n```go\nfunc (c *EndpointClient) Run(ctx context.Context, req dispatchproto.Request) (dispatchproto.Response, error)\n```\nRun sends a RunRequest and returns a RunResponse.\n\n```go\ntype EndpointClientOption func(*EndpointClient)\n```\nEndpointClientOption configures an EndpointClient.\n\n```go\nfunc ClientOptions(opts ...connect.ClientOption) EndpointClientOption\n```\nClientOptions adds options for the underlying connect (gRPC) client.\n\n```go\nfunc HTTPClient(client connect.HTTPClient) EndpointClientOption\n```\nHTTPClient sets the HTTP client to use when making requests to the endpoint.\n\nBy default http.DefaultClient is used.\n\n```go\nfunc RequestHeaders(header http.Header) EndpointClientOption\n```\nRequestHeaders sets headers on the request to the endpoint.\n\n```go\nfunc SigningKey(signingKey ed25519.PrivateKey) EndpointClientOption\n```\nSigningKey sets the signing key to use when signing requests bound for the endpoint.\n\nBy default the EndpointClient does not sign requests to the endpoint.\n\n```go\ntype Handler interface {\n\tHandle(ctx context.Context, header http.Header, calls []dispatchproto.Call) ([]dispatchproto.ID, error)\n}\n```\nHandler handles requests to a Dispatch API server.\n\n```go\nfunc HandlerFunc(fn func(context.Context, http.Header, []dispatchproto.Call) ([]dispatchproto.ID, error)) Handler\n```\nHandlerFunc creates a Handler from a function.\n\n```go\ntype Server struct {\n\t// contains filtered or unexported fields\n}\n```\nServer is a Dispatch API server.\n\n```go\nfunc New(handler Handler, opts ...connect.HandlerOption) (*Server, error)\n```\nNew creates a Server.\n\n```go\nfunc (s *Server) Handler() (string, http.Handler)\n```\nHandler returns an HTTP handler for the Dispatch API server, along with the path that the handler should be registered at.\n\n```go\nfunc (s *Server) Serve(addr string) error\n```\nServe serves the Server on the specified address.\n\n","path":"github.com/dispatchrun/dispatch-go/dispatchserver","name":"dispatchserver","synopsis":"","isRedistributable":true}
