Documentation
¶
Index ¶
- Constants
- func NewAgentServiceHandler(svc AgentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type AgentServiceClient
- type AgentServiceHandler
- type UnimplementedAgentServiceHandler
- func (UnimplementedAgentServiceHandler) AddFeatureApps(context.Context, *connect.Request[v2.AddFeatureAppsRequest]) (*connect.Response[v2.AddFeatureAppsResponse], error)
- func (UnimplementedAgentServiceHandler) CreateFeature(context.Context, *connect.Request[v2.CreateFeatureRequest]) (*connect.Response[v2.CreateFeatureResponse], error)
- func (UnimplementedAgentServiceHandler) DescribeProject(context.Context, *connect.Request[v2.DescribeProjectRequest]) (*connect.Response[v2.DescribeProjectResponse], error)
- func (UnimplementedAgentServiceHandler) Down(context.Context, *connect.Request[v2.DownRequest]) (*connect.Response[v2.DownResponse], error)
- func (UnimplementedAgentServiceHandler) ExpectChange(context.Context, *connect.Request[v2.ExpectChangeRequest]) (*connect.Response[v2.ExpectChangeResponse], error)
- func (UnimplementedAgentServiceHandler) LogSources(context.Context, *connect.Request[v2.LogSourcesRequest]) (*connect.Response[v2.LogSourcesResponse], error)
- func (UnimplementedAgentServiceHandler) Logs(context.Context, *connect.Request[v2.LogsRequest], ...) error
- func (UnimplementedAgentServiceHandler) RemoveFeature(context.Context, *connect.Request[v2.RemoveFeatureRequest]) (*connect.Response[v2.RemoveFeatureResponse], error)
- func (UnimplementedAgentServiceHandler) ResetData(context.Context, *connect.Request[v2.ResetDataRequest]) (*connect.Response[v2.ResetDataResponse], error)
- func (UnimplementedAgentServiceHandler) Resources(context.Context, *connect.Request[v2.ResourcesRequest]) (*connect.Response[v2.ResourcesResponse], error)
- func (UnimplementedAgentServiceHandler) ReviewChanges(context.Context, *connect.Request[v2.ReviewChangesRequest]) (*connect.Response[v2.ReviewChangesResponse], error)
- func (UnimplementedAgentServiceHandler) Routes(context.Context, *connect.Request[v2.RoutesRequest]) (*connect.Response[v2.RoutesResponse], error)
- func (UnimplementedAgentServiceHandler) SetProxy(context.Context, *connect.Request[v2.SetProxyRequest]) (*connect.Response[v2.SetProxyResponse], error)
- func (UnimplementedAgentServiceHandler) SetSleep(context.Context, *connect.Request[v2.SetSleepRequest]) (*connect.Response[v2.SetSleepResponse], error)
- func (UnimplementedAgentServiceHandler) Status(context.Context, *connect.Request[v2.StatusRequest]) (*connect.Response[v2.StatusResponse], error)
- func (UnimplementedAgentServiceHandler) Up(context.Context, *connect.Request[v2.UpRequest]) (*connect.Response[v2.UpResponse], error)
- func (UnimplementedAgentServiceHandler) Watch(context.Context, *connect.Request[v2.WatchRequest], ...) error
Constants ¶
const ( // AgentServiceStatusProcedure is the fully-qualified name of the AgentService's Status RPC. AgentServiceStatusProcedure = "/devopus.agent.v2.AgentService/Status" // AgentServiceUpProcedure is the fully-qualified name of the AgentService's Up RPC. AgentServiceUpProcedure = "/devopus.agent.v2.AgentService/Up" // AgentServiceDownProcedure is the fully-qualified name of the AgentService's Down RPC. AgentServiceDownProcedure = "/devopus.agent.v2.AgentService/Down" // AgentServiceWatchProcedure is the fully-qualified name of the AgentService's Watch RPC. AgentServiceWatchProcedure = "/devopus.agent.v2.AgentService/Watch" // AgentServiceRoutesProcedure is the fully-qualified name of the AgentService's Routes RPC. AgentServiceRoutesProcedure = "/devopus.agent.v2.AgentService/Routes" // AgentServiceSetProxyProcedure is the fully-qualified name of the AgentService's SetProxy RPC. AgentServiceSetProxyProcedure = "/devopus.agent.v2.AgentService/SetProxy" // AgentServiceCreateFeatureProcedure is the fully-qualified name of the AgentService's // CreateFeature RPC. AgentServiceCreateFeatureProcedure = "/devopus.agent.v2.AgentService/CreateFeature" // AgentServiceAddFeatureAppsProcedure is the fully-qualified name of the AgentService's // AddFeatureApps RPC. AgentServiceAddFeatureAppsProcedure = "/devopus.agent.v2.AgentService/AddFeatureApps" // AgentServiceRemoveFeatureProcedure is the fully-qualified name of the AgentService's // RemoveFeature RPC. AgentServiceRemoveFeatureProcedure = "/devopus.agent.v2.AgentService/RemoveFeature" // AgentServiceResetDataProcedure is the fully-qualified name of the AgentService's ResetData RPC. AgentServiceResetDataProcedure = "/devopus.agent.v2.AgentService/ResetData" // AgentServiceSetSleepProcedure is the fully-qualified name of the AgentService's SetSleep RPC. AgentServiceSetSleepProcedure = "/devopus.agent.v2.AgentService/SetSleep" // AgentServiceDescribeProjectProcedure is the fully-qualified name of the AgentService's // DescribeProject RPC. AgentServiceDescribeProjectProcedure = "/devopus.agent.v2.AgentService/DescribeProject" // AgentServiceLogSourcesProcedure is the fully-qualified name of the AgentService's LogSources RPC. AgentServiceLogSourcesProcedure = "/devopus.agent.v2.AgentService/LogSources" // AgentServiceLogsProcedure is the fully-qualified name of the AgentService's Logs RPC. AgentServiceLogsProcedure = "/devopus.agent.v2.AgentService/Logs" // AgentServiceResourcesProcedure is the fully-qualified name of the AgentService's Resources RPC. AgentServiceResourcesProcedure = "/devopus.agent.v2.AgentService/Resources" // AgentServiceReviewChangesProcedure is the fully-qualified name of the AgentService's // ReviewChanges RPC. AgentServiceReviewChangesProcedure = "/devopus.agent.v2.AgentService/ReviewChanges" // AgentServiceExpectChangeProcedure is the fully-qualified name of the AgentService's ExpectChange // RPC. AgentServiceExpectChangeProcedure = "/devopus.agent.v2.AgentService/ExpectChange" )
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 = "devopus.agent.v2.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 {
// Status reports the agent, the container runtime and every environment.
Status(context.Context, *connect.Request[v2.StatusRequest]) (*connect.Response[v2.StatusResponse], error)
// Up registers a project from its workspace.yaml and wants its base environment running.
Up(context.Context, *connect.Request[v2.UpRequest]) (*connect.Response[v2.UpResponse], error)
// Down stops the base environment of a project, or removes the project with purge.
Down(context.Context, *connect.Request[v2.DownRequest]) (*connect.Response[v2.DownResponse], error)
// Watch streams environment status: the current status first, then every change.
Watch(context.Context, *connect.Request[v2.WatchRequest]) (*connect.ServerStreamForClient[v2.WatchResponse], error)
// Routes is the proxy's routing table.
Routes(context.Context, *connect.Request[v2.RoutesRequest]) (*connect.Response[v2.RoutesResponse], error)
// SetProxy changes the device's proxy settings: coexistence with a dev server, restart.
SetProxy(context.Context, *connect.Request[v2.SetProxyRequest]) (*connect.Response[v2.SetProxyResponse], error)
// CreateFeature adds a feature environment that forks some applications of a project.
CreateFeature(context.Context, *connect.Request[v2.CreateFeatureRequest]) (*connect.Response[v2.CreateFeatureResponse], error)
// AddFeatureApps forks more applications in an existing feature.
AddFeatureApps(context.Context, *connect.Request[v2.AddFeatureAppsRequest]) (*connect.Response[v2.AddFeatureAppsResponse], error)
// RemoveFeature removes a feature with its containers, data and worktrees. Without
// force it refuses while a worktree has work that exists nowhere else.
RemoveFeature(context.Context, *connect.Request[v2.RemoveFeatureRequest]) (*connect.Response[v2.RemoveFeatureResponse], error)
// ResetData recreates a feature's databases from the golden copies, or refreshes the
// golden copies of the base environment.
ResetData(context.Context, *connect.Request[v2.ResetDataRequest]) (*connect.Response[v2.ResetDataResponse], error)
// SetSleep puts a feature to sleep or wakes it up.
SetSleep(context.Context, *connect.Request[v2.SetSleepRequest]) (*connect.Response[v2.SetSleepResponse], error)
// DescribeProject reads a registered project's workspace.yaml from its folder: what
// the panel offers to fork, and what a feature that forks the given applications gets.
DescribeProject(context.Context, *connect.Request[v2.DescribeProjectRequest]) (*connect.Response[v2.DescribeProjectResponse], error)
LogSources(context.Context, *connect.Request[v2.LogSourcesRequest]) (*connect.Response[v2.LogSourcesResponse], error)
Logs(context.Context, *connect.Request[v2.LogsRequest]) (*connect.ServerStreamForClient[v2.LogsResponse], error)
Resources(context.Context, *connect.Request[v2.ResourcesRequest]) (*connect.Response[v2.ResourcesResponse], error)
// ReviewChanges accepts or declines the version of a server project that waits for
// the user (ProjectSpec.pending).
ReviewChanges(context.Context, *connect.Request[v2.ReviewChangesRequest]) (*connect.Response[v2.ReviewChangesResponse], error)
// ExpectChange tells the agent what its user is changing in a server project, so
// that the version with it is applied without asking them.
ExpectChange(context.Context, *connect.Request[v2.ExpectChangeRequest]) (*connect.Response[v2.ExpectChangeResponse], error)
}
AgentServiceClient is a client for the devopus.agent.v2.AgentService service.
func NewAgentServiceClient ¶
func NewAgentServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AgentServiceClient
NewAgentServiceClient constructs a client for the devopus.agent.v2.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 {
// Status reports the agent, the container runtime and every environment.
Status(context.Context, *connect.Request[v2.StatusRequest]) (*connect.Response[v2.StatusResponse], error)
// Up registers a project from its workspace.yaml and wants its base environment running.
Up(context.Context, *connect.Request[v2.UpRequest]) (*connect.Response[v2.UpResponse], error)
// Down stops the base environment of a project, or removes the project with purge.
Down(context.Context, *connect.Request[v2.DownRequest]) (*connect.Response[v2.DownResponse], error)
// Watch streams environment status: the current status first, then every change.
Watch(context.Context, *connect.Request[v2.WatchRequest], *connect.ServerStream[v2.WatchResponse]) error
// Routes is the proxy's routing table.
Routes(context.Context, *connect.Request[v2.RoutesRequest]) (*connect.Response[v2.RoutesResponse], error)
// SetProxy changes the device's proxy settings: coexistence with a dev server, restart.
SetProxy(context.Context, *connect.Request[v2.SetProxyRequest]) (*connect.Response[v2.SetProxyResponse], error)
// CreateFeature adds a feature environment that forks some applications of a project.
CreateFeature(context.Context, *connect.Request[v2.CreateFeatureRequest]) (*connect.Response[v2.CreateFeatureResponse], error)
// AddFeatureApps forks more applications in an existing feature.
AddFeatureApps(context.Context, *connect.Request[v2.AddFeatureAppsRequest]) (*connect.Response[v2.AddFeatureAppsResponse], error)
// RemoveFeature removes a feature with its containers, data and worktrees. Without
// force it refuses while a worktree has work that exists nowhere else.
RemoveFeature(context.Context, *connect.Request[v2.RemoveFeatureRequest]) (*connect.Response[v2.RemoveFeatureResponse], error)
// ResetData recreates a feature's databases from the golden copies, or refreshes the
// golden copies of the base environment.
ResetData(context.Context, *connect.Request[v2.ResetDataRequest]) (*connect.Response[v2.ResetDataResponse], error)
// SetSleep puts a feature to sleep or wakes it up.
SetSleep(context.Context, *connect.Request[v2.SetSleepRequest]) (*connect.Response[v2.SetSleepResponse], error)
// DescribeProject reads a registered project's workspace.yaml from its folder: what
// the panel offers to fork, and what a feature that forks the given applications gets.
DescribeProject(context.Context, *connect.Request[v2.DescribeProjectRequest]) (*connect.Response[v2.DescribeProjectResponse], error)
LogSources(context.Context, *connect.Request[v2.LogSourcesRequest]) (*connect.Response[v2.LogSourcesResponse], error)
Logs(context.Context, *connect.Request[v2.LogsRequest], *connect.ServerStream[v2.LogsResponse]) error
Resources(context.Context, *connect.Request[v2.ResourcesRequest]) (*connect.Response[v2.ResourcesResponse], error)
// ReviewChanges accepts or declines the version of a server project that waits for
// the user (ProjectSpec.pending).
ReviewChanges(context.Context, *connect.Request[v2.ReviewChangesRequest]) (*connect.Response[v2.ReviewChangesResponse], error)
// ExpectChange tells the agent what its user is changing in a server project, so
// that the version with it is applied without asking them.
ExpectChange(context.Context, *connect.Request[v2.ExpectChangeRequest]) (*connect.Response[v2.ExpectChangeResponse], error)
}
AgentServiceHandler is an implementation of the devopus.agent.v2.AgentService service.
type UnimplementedAgentServiceHandler ¶
type UnimplementedAgentServiceHandler struct{}
UnimplementedAgentServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedAgentServiceHandler) AddFeatureApps ¶
func (UnimplementedAgentServiceHandler) AddFeatureApps(context.Context, *connect.Request[v2.AddFeatureAppsRequest]) (*connect.Response[v2.AddFeatureAppsResponse], error)
func (UnimplementedAgentServiceHandler) CreateFeature ¶
func (UnimplementedAgentServiceHandler) CreateFeature(context.Context, *connect.Request[v2.CreateFeatureRequest]) (*connect.Response[v2.CreateFeatureResponse], error)
func (UnimplementedAgentServiceHandler) DescribeProject ¶
func (UnimplementedAgentServiceHandler) DescribeProject(context.Context, *connect.Request[v2.DescribeProjectRequest]) (*connect.Response[v2.DescribeProjectResponse], error)
func (UnimplementedAgentServiceHandler) Down ¶
func (UnimplementedAgentServiceHandler) Down(context.Context, *connect.Request[v2.DownRequest]) (*connect.Response[v2.DownResponse], error)
func (UnimplementedAgentServiceHandler) ExpectChange ¶
func (UnimplementedAgentServiceHandler) ExpectChange(context.Context, *connect.Request[v2.ExpectChangeRequest]) (*connect.Response[v2.ExpectChangeResponse], error)
func (UnimplementedAgentServiceHandler) LogSources ¶
func (UnimplementedAgentServiceHandler) LogSources(context.Context, *connect.Request[v2.LogSourcesRequest]) (*connect.Response[v2.LogSourcesResponse], error)
func (UnimplementedAgentServiceHandler) Logs ¶
func (UnimplementedAgentServiceHandler) Logs(context.Context, *connect.Request[v2.LogsRequest], *connect.ServerStream[v2.LogsResponse]) error
func (UnimplementedAgentServiceHandler) RemoveFeature ¶
func (UnimplementedAgentServiceHandler) RemoveFeature(context.Context, *connect.Request[v2.RemoveFeatureRequest]) (*connect.Response[v2.RemoveFeatureResponse], error)
func (UnimplementedAgentServiceHandler) ResetData ¶
func (UnimplementedAgentServiceHandler) ResetData(context.Context, *connect.Request[v2.ResetDataRequest]) (*connect.Response[v2.ResetDataResponse], error)
func (UnimplementedAgentServiceHandler) Resources ¶
func (UnimplementedAgentServiceHandler) Resources(context.Context, *connect.Request[v2.ResourcesRequest]) (*connect.Response[v2.ResourcesResponse], error)
func (UnimplementedAgentServiceHandler) ReviewChanges ¶
func (UnimplementedAgentServiceHandler) ReviewChanges(context.Context, *connect.Request[v2.ReviewChangesRequest]) (*connect.Response[v2.ReviewChangesResponse], error)
func (UnimplementedAgentServiceHandler) Routes ¶
func (UnimplementedAgentServiceHandler) Routes(context.Context, *connect.Request[v2.RoutesRequest]) (*connect.Response[v2.RoutesResponse], error)
func (UnimplementedAgentServiceHandler) SetProxy ¶
func (UnimplementedAgentServiceHandler) SetProxy(context.Context, *connect.Request[v2.SetProxyRequest]) (*connect.Response[v2.SetProxyResponse], error)
func (UnimplementedAgentServiceHandler) SetSleep ¶
func (UnimplementedAgentServiceHandler) SetSleep(context.Context, *connect.Request[v2.SetSleepRequest]) (*connect.Response[v2.SetSleepResponse], error)
func (UnimplementedAgentServiceHandler) Status ¶
func (UnimplementedAgentServiceHandler) Status(context.Context, *connect.Request[v2.StatusRequest]) (*connect.Response[v2.StatusResponse], error)
func (UnimplementedAgentServiceHandler) Watch ¶
func (UnimplementedAgentServiceHandler) Watch(context.Context, *connect.Request[v2.WatchRequest], *connect.ServerStream[v2.WatchResponse]) error