agentv1connect

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
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.

View Source
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) GetAgent

func (UnimplementedAgentServiceHandler) ListAgents

func (UnimplementedAgentServiceHandler) UpdateAgent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL