Documentation
¶
Index ¶
- Constants
- func NewAgentServiceHandler(svc AgentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type AgentServiceClient
- type AgentServiceHandler
- type UnimplementedAgentServiceHandler
- func (UnimplementedAgentServiceHandler) CreateAgent(context.Context, *connect.Request[v1.CreateAgentRequest]) (*connect.Response[v1.Agent], error)
- func (UnimplementedAgentServiceHandler) DeleteAgent(context.Context, *connect.Request[v1.DeleteAgentRequest]) (*connect.Response[v1.DeleteAgentResponse], error)
- func (UnimplementedAgentServiceHandler) GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.Agent], error)
- func (UnimplementedAgentServiceHandler) GetConfig(context.Context, *connect.Request[v1.GetConfigRequest]) (*connect.Response[v1.GetConfigResponse], error)
- func (UnimplementedAgentServiceHandler) ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.Agents], error)
- func (UnimplementedAgentServiceHandler) UpdateAgent(context.Context, *connect.Request[v1.UpdateAgentRequest]) (*connect.Response[v1.Agent], error)
Constants ¶
const ( // AgentServiceGetConfigProcedure is the fully-qualified name of the AgentService's GetConfig RPC. AgentServiceGetConfigProcedure = "/agent.v1.AgentService/GetConfig" // AgentServiceGetAgentProcedure is the fully-qualified name of the AgentService's GetAgent RPC. AgentServiceGetAgentProcedure = "/agent.v1.AgentService/GetAgent" // AgentServiceListAgentsProcedure is the fully-qualified name of the AgentService's ListAgents RPC. AgentServiceListAgentsProcedure = "/agent.v1.AgentService/ListAgents" // AgentServiceCreateAgentProcedure is the fully-qualified name of the AgentService's CreateAgent // RPC. AgentServiceCreateAgentProcedure = "/agent.v1.AgentService/CreateAgent" // AgentServiceUpdateAgentProcedure is the fully-qualified name of the AgentService's UpdateAgent // RPC. AgentServiceUpdateAgentProcedure = "/agent.v1.AgentService/UpdateAgent" // AgentServiceDeleteAgentProcedure is the fully-qualified name of the AgentService's DeleteAgent // RPC. AgentServiceDeleteAgentProcedure = "/agent.v1.AgentService/DeleteAgent" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// AgentServiceName is the fully-qualified name of the AgentService service.
AgentServiceName = "agent.v1.AgentService"
)
Variables ¶
This section is empty.
Functions ¶
func NewAgentServiceHandler ¶
func NewAgentServiceHandler(svc AgentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewAgentServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type AgentServiceClient ¶
type AgentServiceClient interface { // GetConfig returns the agent's configuration. GetConfig(context.Context, *connect.Request[v1.GetConfigRequest]) (*connect.Response[v1.GetConfigResponse], error) // GetAgent returns information about the agent. GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.Agent], error) // ListAgents returns information about all agents. ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.Agents], error) // CreateAgent registers a new agent. CreateAgent(context.Context, *connect.Request[v1.CreateAgentRequest]) (*connect.Response[v1.Agent], error) // UpdateAgent updates an existing agent. UpdateAgent(context.Context, *connect.Request[v1.UpdateAgentRequest]) (*connect.Response[v1.Agent], error) // DeleteAgent deletes an existing agent. DeleteAgent(context.Context, *connect.Request[v1.DeleteAgentRequest]) (*connect.Response[v1.DeleteAgentResponse], error) }
AgentServiceClient is a client for the agent.v1.AgentService service.
func NewAgentServiceClient ¶
func NewAgentServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AgentServiceClient
NewAgentServiceClient constructs a client for the agent.v1.AgentService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type AgentServiceHandler ¶
type AgentServiceHandler interface { // GetConfig returns the agent's configuration. GetConfig(context.Context, *connect.Request[v1.GetConfigRequest]) (*connect.Response[v1.GetConfigResponse], error) // GetAgent returns information about the agent. GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.Agent], error) // ListAgents returns information about all agents. ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.Agents], error) // CreateAgent registers a new agent. CreateAgent(context.Context, *connect.Request[v1.CreateAgentRequest]) (*connect.Response[v1.Agent], error) // UpdateAgent updates an existing agent. UpdateAgent(context.Context, *connect.Request[v1.UpdateAgentRequest]) (*connect.Response[v1.Agent], error) // DeleteAgent deletes an existing agent. DeleteAgent(context.Context, *connect.Request[v1.DeleteAgentRequest]) (*connect.Response[v1.DeleteAgentResponse], error) }
AgentServiceHandler is an implementation of the agent.v1.AgentService service.
type UnimplementedAgentServiceHandler ¶
type UnimplementedAgentServiceHandler struct{}
UnimplementedAgentServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedAgentServiceHandler) CreateAgent ¶
func (UnimplementedAgentServiceHandler) DeleteAgent ¶
func (UnimplementedAgentServiceHandler) DeleteAgent(context.Context, *connect.Request[v1.DeleteAgentRequest]) (*connect.Response[v1.DeleteAgentResponse], error)
func (UnimplementedAgentServiceHandler) GetConfig ¶
func (UnimplementedAgentServiceHandler) GetConfig(context.Context, *connect.Request[v1.GetConfigRequest]) (*connect.Response[v1.GetConfigResponse], error)