Documentation
¶
Index ¶
- Constants
- func NewAgentHandler(svc AgentHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type AgentClient
- type AgentHandler
- type UnimplementedAgentHandler
- func (UnimplementedAgentHandler) GetAgentInformation(context.Context, *connect.Request[v0.AgentInformationRequest]) (*connect.Response[v0.AgentInformation], error)
- func (UnimplementedAgentHandler) ListCommands(context.Context, *connect.Request[v0.ListCommandsRequest]) (*connect.Response[v0.ListCommandsResponse], error)
- func (UnimplementedAgentHandler) RunPluginCommand(context.Context, *connect.Request[v0.RunPluginCommandRequest]) (*connect.Response[v0.RunPluginCommandResponse], error)
Constants ¶
const ( // AgentGetAgentInformationProcedure is the fully-qualified name of the Agent's GetAgentInformation // RPC. AgentGetAgentInformationProcedure = "/codefly.services.agent.v0.Agent/GetAgentInformation" // AgentListCommandsProcedure is the fully-qualified name of the Agent's ListCommands RPC. AgentListCommandsProcedure = "/codefly.services.agent.v0.Agent/ListCommands" // AgentRunPluginCommandProcedure is the fully-qualified name of the Agent's RunPluginCommand RPC. AgentRunPluginCommandProcedure = "/codefly.services.agent.v0.Agent/RunPluginCommand" )
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 (
// AgentName is the fully-qualified name of the Agent service.
AgentName = "codefly.services.agent.v0.Agent"
)
Variables ¶
This section is empty.
Functions ¶
func NewAgentHandler ¶
func NewAgentHandler(svc AgentHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewAgentHandler 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 AgentClient ¶
type AgentClient interface {
// GetAgentInformation returns the agent manifest, capabilities, and configuration docs.
GetAgentInformation(context.Context, *connect.Request[v0.AgentInformationRequest]) (*connect.Response[v0.AgentInformation], error)
// ListCommands returns the commands this plugin agent provides.
ListCommands(context.Context, *connect.Request[v0.ListCommandsRequest]) (*connect.Response[v0.ListCommandsResponse], error)
// RunPluginCommand executes a plugin-provided command.
RunPluginCommand(context.Context, *connect.Request[v0.RunPluginCommandRequest]) (*connect.Response[v0.RunPluginCommandResponse], error)
}
AgentClient is a client for the codefly.services.agent.v0.Agent service.
func NewAgentClient ¶
func NewAgentClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AgentClient
NewAgentClient constructs a client for the codefly.services.agent.v0.Agent 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 AgentHandler ¶
type AgentHandler interface {
// GetAgentInformation returns the agent manifest, capabilities, and configuration docs.
GetAgentInformation(context.Context, *connect.Request[v0.AgentInformationRequest]) (*connect.Response[v0.AgentInformation], error)
// ListCommands returns the commands this plugin agent provides.
ListCommands(context.Context, *connect.Request[v0.ListCommandsRequest]) (*connect.Response[v0.ListCommandsResponse], error)
// RunPluginCommand executes a plugin-provided command.
RunPluginCommand(context.Context, *connect.Request[v0.RunPluginCommandRequest]) (*connect.Response[v0.RunPluginCommandResponse], error)
}
AgentHandler is an implementation of the codefly.services.agent.v0.Agent service.
type UnimplementedAgentHandler ¶
type UnimplementedAgentHandler struct{}
UnimplementedAgentHandler returns CodeUnimplemented from all methods.
func (UnimplementedAgentHandler) GetAgentInformation ¶
func (UnimplementedAgentHandler) GetAgentInformation(context.Context, *connect.Request[v0.AgentInformationRequest]) (*connect.Response[v0.AgentInformation], error)
func (UnimplementedAgentHandler) ListCommands ¶
func (UnimplementedAgentHandler) ListCommands(context.Context, *connect.Request[v0.ListCommandsRequest]) (*connect.Response[v0.ListCommandsResponse], error)
func (UnimplementedAgentHandler) RunPluginCommand ¶
func (UnimplementedAgentHandler) RunPluginCommand(context.Context, *connect.Request[v0.RunPluginCommandRequest]) (*connect.Response[v0.RunPluginCommandResponse], error)