Documentation
¶
Index ¶
- Constants
- func RegisterSpectreServiceHandler(server *connect.Server, svc SpectreServiceHandler)
- type SpectreServiceClient
- type SpectreServiceHandler
- type SpectreServiceUpdateClientStream
- type SpectreServiceUpdateServerStream
- type UnimplementedSpectreServiceHandler
- func (UnimplementedSpectreServiceHandler) ClearDivergences(context.Context, *spectrepb.ClearDivergencesRequest) (*spectrepb.ClearDivergencesResponse, error)
- func (UnimplementedSpectreServiceHandler) ListDivergences(context.Context, *spectrepb.ListDivergencesRequest) (*spectrepb.ListDivergencesResponse, error)
- func (UnimplementedSpectreServiceHandler) Update(context.Context, SpectreServiceUpdateServerStream) (*spectrepb.UpdateResponse, error)
Constants ¶
const ( // SpectreServiceUpdateProcedure is the procedure name of the SpectreService's Update RPC. SpectreServiceUpdateProcedure = "/spectre.v1.SpectreService/Update" // SpectreServiceListDivergencesProcedure is the procedure name of the SpectreService's // ListDivergences RPC. SpectreServiceListDivergencesProcedure = "/spectre.v1.SpectreService/ListDivergences" // SpectreServiceClearDivergencesProcedure is the procedure name of the SpectreService's // ClearDivergences RPC. SpectreServiceClearDivergencesProcedure = "/spectre.v1.SpectreService/ClearDivergences" )
These constants are the procedure 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 (
// SpectreServiceName is the fully-qualified name of the SpectreService service.
SpectreServiceName = "spectre.v1.SpectreService"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterSpectreServiceHandler ¶ added in v0.45.4
func RegisterSpectreServiceHandler(server *connect.Server, svc SpectreServiceHandler)
RegisterSpectreServiceHandler registers svc as the spectre.v1.SpectreService implementation on server.
Types ¶
type SpectreServiceClient ¶
type SpectreServiceClient interface {
// Update streams a mirror's state for as long as the mirror runs. Each
// stream begins with the whole state, then changes it or keeps it alive.
Update(context.Context) (SpectreServiceUpdateClientStream, error)
// ListDivergences returns the state of each mirror the server still
// considers current, and the latest divergence each mirror reported.
ListDivergences(context.Context, *spectrepb.ListDivergencesRequest) (*spectrepb.ListDivergencesResponse, error)
// ClearDivergences removes the divergences of one service environment, and
// ignores quarantines that began before it.
ClearDivergences(context.Context, *spectrepb.ClearDivergencesRequest) (*spectrepb.ClearDivergencesResponse, error)
}
SpectreServiceClient is a client for the spectre.v1.SpectreService service.
func NewSpectreServiceClient ¶
func NewSpectreServiceClient(client *connect.Client) SpectreServiceClient
NewSpectreServiceClient constructs a client for the spectre.v1.SpectreService service. Multiple service clients may share a single connect.Client.
type SpectreServiceHandler ¶
type SpectreServiceHandler interface {
// Update streams a mirror's state for as long as the mirror runs. Each
// stream begins with the whole state, then changes it or keeps it alive.
Update(context.Context, SpectreServiceUpdateServerStream) (*spectrepb.UpdateResponse, error)
// ListDivergences returns the state of each mirror the server still
// considers current, and the latest divergence each mirror reported.
ListDivergences(context.Context, *spectrepb.ListDivergencesRequest) (*spectrepb.ListDivergencesResponse, error)
// ClearDivergences removes the divergences of one service environment, and
// ignores quarantines that began before it.
ClearDivergences(context.Context, *spectrepb.ClearDivergencesRequest) (*spectrepb.ClearDivergencesResponse, error)
}
SpectreServiceHandler is an implementation of the spectre.v1.SpectreService service.
type SpectreServiceUpdateClientStream ¶ added in v0.48.0
type SpectreServiceUpdateClientStream struct {
// contains filtered or unexported fields
}
SpectreServiceUpdateClientStream is the client stream for the SpectreService's Update RPC.
func (SpectreServiceUpdateClientStream) CloseAndReceive ¶ added in v0.48.0
func (s SpectreServiceUpdateClientStream) CloseAndReceive() (*spectrepb.UpdateResponse, error)
CloseAndReceive closes the request side of the stream and returns the single response message. It reads the stream to completion to release its resources.
func (SpectreServiceUpdateClientStream) Send ¶ added in v0.48.0
func (s SpectreServiceUpdateClientStream) Send(req *spectrepb.UpdateRequest) error
Send sends a request message to the server.
func (SpectreServiceUpdateClientStream) SendHeaders ¶ added in v0.48.0
func (s SpectreServiceUpdateClientStream) SendHeaders() error
SendHeaders opens the stream and flushes the request headers without a message. The first Send or Receive does this implicitly.
type SpectreServiceUpdateServerStream ¶ added in v0.48.0
type SpectreServiceUpdateServerStream struct {
// contains filtered or unexported fields
}
SpectreServiceUpdateServerStream is the server stream for the SpectreService's Update RPC.
func (SpectreServiceUpdateServerStream) Receive ¶ added in v0.48.0
func (s SpectreServiceUpdateServerStream) Receive() (*spectrepb.UpdateRequest, error)
Receive returns the next request message from the client.
type UnimplementedSpectreServiceHandler ¶
type UnimplementedSpectreServiceHandler struct{}
UnimplementedSpectreServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedSpectreServiceHandler) ClearDivergences ¶
func (UnimplementedSpectreServiceHandler) ClearDivergences(context.Context, *spectrepb.ClearDivergencesRequest) (*spectrepb.ClearDivergencesResponse, error)
func (UnimplementedSpectreServiceHandler) ListDivergences ¶
func (UnimplementedSpectreServiceHandler) ListDivergences(context.Context, *spectrepb.ListDivergencesRequest) (*spectrepb.ListDivergencesResponse, error)