capsuleconnect

package
v0.0.0-...-4415367 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ServiceCreateProcedure is the fully-qualified name of the Service's Create RPC.
	ServiceCreateProcedure = "/api.v1.capsule.Service/Create"
	// ServiceGetProcedure is the fully-qualified name of the Service's Get RPC.
	ServiceGetProcedure = "/api.v1.capsule.Service/Get"
	// ServiceDeleteProcedure is the fully-qualified name of the Service's Delete RPC.
	ServiceDeleteProcedure = "/api.v1.capsule.Service/Delete"
	// ServiceLogsProcedure is the fully-qualified name of the Service's Logs RPC.
	ServiceLogsProcedure = "/api.v1.capsule.Service/Logs"
	// ServiceUpdateProcedure is the fully-qualified name of the Service's Update RPC.
	ServiceUpdateProcedure = "/api.v1.capsule.Service/Update"
	// ServiceListProcedure is the fully-qualified name of the Service's List RPC.
	ServiceListProcedure = "/api.v1.capsule.Service/List"
	// ServiceGetByNameProcedure is the fully-qualified name of the Service's GetByName RPC.
	ServiceGetByNameProcedure = "/api.v1.capsule.Service/GetByName"
	// ServiceCreateBuildProcedure is the fully-qualified name of the Service's CreateBuild RPC.
	ServiceCreateBuildProcedure = "/api.v1.capsule.Service/CreateBuild"
	// ServiceListBuildsProcedure is the fully-qualified name of the Service's ListBuilds RPC.
	ServiceListBuildsProcedure = "/api.v1.capsule.Service/ListBuilds"
	// ServiceDeleteBuildProcedure is the fully-qualified name of the Service's DeleteBuild RPC.
	ServiceDeleteBuildProcedure = "/api.v1.capsule.Service/DeleteBuild"
	// ServiceDeployProcedure is the fully-qualified name of the Service's Deploy RPC.
	ServiceDeployProcedure = "/api.v1.capsule.Service/Deploy"
	// ServiceListInstancesProcedure is the fully-qualified name of the Service's ListInstances RPC.
	ServiceListInstancesProcedure = "/api.v1.capsule.Service/ListInstances"
	// ServiceRestartInstanceProcedure is the fully-qualified name of the Service's RestartInstance RPC.
	ServiceRestartInstanceProcedure = "/api.v1.capsule.Service/RestartInstance"
	// ServiceGetRolloutProcedure is the fully-qualified name of the Service's GetRollout RPC.
	ServiceGetRolloutProcedure = "/api.v1.capsule.Service/GetRollout"
	// ServiceListRolloutsProcedure is the fully-qualified name of the Service's ListRollouts RPC.
	ServiceListRolloutsProcedure = "/api.v1.capsule.Service/ListRollouts"
	// ServiceAbortRolloutProcedure is the fully-qualified name of the Service's AbortRollout RPC.
	ServiceAbortRolloutProcedure = "/api.v1.capsule.Service/AbortRollout"
	// ServiceListEventsProcedure is the fully-qualified name of the Service's ListEvents RPC.
	ServiceListEventsProcedure = "/api.v1.capsule.Service/ListEvents"
	// ServiceCapsuleMetricsProcedure is the fully-qualified name of the Service's CapsuleMetrics RPC.
	ServiceCapsuleMetricsProcedure = "/api.v1.capsule.Service/CapsuleMetrics"
)

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 (
	// ServiceName is the fully-qualified name of the Service service.
	ServiceName = "api.v1.capsule.Service"
)

Variables

This section is empty.

Functions

func NewServiceHandler

func NewServiceHandler(svc ServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler)

NewServiceHandler 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 ServiceClient

type ServiceClient interface {
	// Create a new capsule.
	Create(context.Context, *connect_go.Request[capsule.CreateRequest]) (*connect_go.Response[capsule.CreateResponse], error)
	// Get a capsule by id.
	Get(context.Context, *connect_go.Request[capsule.GetRequest]) (*connect_go.Response[capsule.GetResponse], error)
	// Delete a capsule.
	Delete(context.Context, *connect_go.Request[capsule.DeleteRequest]) (*connect_go.Response[capsule.DeleteResponse], error)
	// Logs returns (and streams) the log output of a capsule.
	Logs(context.Context, *connect_go.Request[capsule.LogsRequest]) (*connect_go.ServerStreamForClient[capsule.LogsResponse], error)
	// Update a capsule.
	Update(context.Context, *connect_go.Request[capsule.UpdateRequest]) (*connect_go.Response[capsule.UpdateResponse], error)
	// Lists all capsules for current project.
	List(context.Context, *connect_go.Request[capsule.ListRequest]) (*connect_go.Response[capsule.ListResponse], error)
	// Get a capsule by name.
	GetByName(context.Context, *connect_go.Request[capsule.GetByNameRequest]) (*connect_go.Response[capsule.GetByNameResponse], error)
	// Create a new build.
	// Builds are immutable and cannot change. Create a new build to make
	// changes from an existing one.
	CreateBuild(context.Context, *connect_go.Request[capsule.CreateBuildRequest]) (*connect_go.Response[capsule.CreateBuildResponse], error)
	// List builds for a capsule.
	ListBuilds(context.Context, *connect_go.Request[capsule.ListBuildsRequest]) (*connect_go.Response[capsule.ListBuildsResponse], error)
	// Delete a build.
	DeleteBuild(context.Context, *connect_go.Request[capsule.DeleteBuildRequest]) (*connect_go.Response[capsule.DeleteBuildResponse], error)
	// Deploy changes to a capsule.
	// When deploying, a new rollout will be initiated. Only one rollout can be
	// running at a single point in time.
	// Use `Abort` to abort an already running rollout.
	Deploy(context.Context, *connect_go.Request[capsule.DeployRequest]) (*connect_go.Response[capsule.DeployResponse], error)
	// Lists all instances for the capsule.
	ListInstances(context.Context, *connect_go.Request[capsule.ListInstancesRequest]) (*connect_go.Response[capsule.ListInstancesResponse], error)
	// Restart a single capsule instance.
	RestartInstance(context.Context, *connect_go.Request[capsule.RestartInstanceRequest]) (*connect_go.Response[capsule.RestartInstanceResponse], error)
	// Get a single rollout by ID.
	GetRollout(context.Context, *connect_go.Request[capsule.GetRolloutRequest]) (*connect_go.Response[capsule.GetRolloutResponse], error)
	// Lists all rollouts for the capsule.
	ListRollouts(context.Context, *connect_go.Request[capsule.ListRolloutsRequest]) (*connect_go.Response[capsule.ListRolloutsResponse], error)
	// Abort the rollout.
	AbortRollout(context.Context, *connect_go.Request[capsule.AbortRolloutRequest]) (*connect_go.Response[capsule.AbortRolloutResponse], error)
	ListEvents(context.Context, *connect_go.Request[capsule.ListEventsRequest]) (*connect_go.Response[capsule.ListEventsResponse], error)
	// Get metrics for a capsule
	CapsuleMetrics(context.Context, *connect_go.Request[capsule.CapsuleMetricsRequest]) (*connect_go.Response[capsule.CapsuleMetricsResponse], error)
}

ServiceClient is a client for the api.v1.capsule.Service service.

func NewServiceClient

func NewServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) ServiceClient

NewServiceClient constructs a client for the api.v1.capsule.Service 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 ServiceHandler

type ServiceHandler interface {
	// Create a new capsule.
	Create(context.Context, *connect_go.Request[capsule.CreateRequest]) (*connect_go.Response[capsule.CreateResponse], error)
	// Get a capsule by id.
	Get(context.Context, *connect_go.Request[capsule.GetRequest]) (*connect_go.Response[capsule.GetResponse], error)
	// Delete a capsule.
	Delete(context.Context, *connect_go.Request[capsule.DeleteRequest]) (*connect_go.Response[capsule.DeleteResponse], error)
	// Logs returns (and streams) the log output of a capsule.
	Logs(context.Context, *connect_go.Request[capsule.LogsRequest], *connect_go.ServerStream[capsule.LogsResponse]) error
	// Update a capsule.
	Update(context.Context, *connect_go.Request[capsule.UpdateRequest]) (*connect_go.Response[capsule.UpdateResponse], error)
	// Lists all capsules for current project.
	List(context.Context, *connect_go.Request[capsule.ListRequest]) (*connect_go.Response[capsule.ListResponse], error)
	// Get a capsule by name.
	GetByName(context.Context, *connect_go.Request[capsule.GetByNameRequest]) (*connect_go.Response[capsule.GetByNameResponse], error)
	// Create a new build.
	// Builds are immutable and cannot change. Create a new build to make
	// changes from an existing one.
	CreateBuild(context.Context, *connect_go.Request[capsule.CreateBuildRequest]) (*connect_go.Response[capsule.CreateBuildResponse], error)
	// List builds for a capsule.
	ListBuilds(context.Context, *connect_go.Request[capsule.ListBuildsRequest]) (*connect_go.Response[capsule.ListBuildsResponse], error)
	// Delete a build.
	DeleteBuild(context.Context, *connect_go.Request[capsule.DeleteBuildRequest]) (*connect_go.Response[capsule.DeleteBuildResponse], error)
	// Deploy changes to a capsule.
	// When deploying, a new rollout will be initiated. Only one rollout can be
	// running at a single point in time.
	// Use `Abort` to abort an already running rollout.
	Deploy(context.Context, *connect_go.Request[capsule.DeployRequest]) (*connect_go.Response[capsule.DeployResponse], error)
	// Lists all instances for the capsule.
	ListInstances(context.Context, *connect_go.Request[capsule.ListInstancesRequest]) (*connect_go.Response[capsule.ListInstancesResponse], error)
	// Restart a single capsule instance.
	RestartInstance(context.Context, *connect_go.Request[capsule.RestartInstanceRequest]) (*connect_go.Response[capsule.RestartInstanceResponse], error)
	// Get a single rollout by ID.
	GetRollout(context.Context, *connect_go.Request[capsule.GetRolloutRequest]) (*connect_go.Response[capsule.GetRolloutResponse], error)
	// Lists all rollouts for the capsule.
	ListRollouts(context.Context, *connect_go.Request[capsule.ListRolloutsRequest]) (*connect_go.Response[capsule.ListRolloutsResponse], error)
	// Abort the rollout.
	AbortRollout(context.Context, *connect_go.Request[capsule.AbortRolloutRequest]) (*connect_go.Response[capsule.AbortRolloutResponse], error)
	ListEvents(context.Context, *connect_go.Request[capsule.ListEventsRequest]) (*connect_go.Response[capsule.ListEventsResponse], error)
	// Get metrics for a capsule
	CapsuleMetrics(context.Context, *connect_go.Request[capsule.CapsuleMetricsRequest]) (*connect_go.Response[capsule.CapsuleMetricsResponse], error)
}

ServiceHandler is an implementation of the api.v1.capsule.Service service.

type UnimplementedServiceHandler

type UnimplementedServiceHandler struct{}

UnimplementedServiceHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

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