Documentation
¶
Overview ¶
Package server is the SPECTRE server, which collects the states that mirrors stream. It keeps their states and divergences in memory or in Redis.
Index ¶
- func Serve(ctx context.Context, config ServeConfig) error
- type ClearConfig
- type ServeConfig
- type Service
- func (s *Service) ClearDivergences(ctx context.Context, request *pb.ClearDivergencesRequest) (*pb.ClearDivergencesResponse, error)
- func (s *Service) Handler() http.Handler
- func (s *Service) ListDivergences(ctx context.Context, request *pb.ListDivergencesRequest) (*pb.ListDivergencesResponse, error)
- func (s *Service) Update(ctx context.Context, updates spectrepbconnect.SpectreServiceUpdateServerStream) (*pb.UpdateResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClearConfig ¶
type ClearConfig struct {
Service string `required:"" help:"Service whose divergences to clear."`
Environment string `required:"" help:"Environment whose divergences to clear."`
}
ClearConfig names the service environment whose divergences to clear.
type ServeConfig ¶
type ServeConfig struct {
Listen string `default:"127.0.0.1:50070" help:"Address for the SPECTRE server: host:port, or unix:<path|@abstract>."`
Storage storage.Config `embed:""`
StateTTL time.Duration `` /* 126-byte string literal not displayed */
}
ServeConfig configures the SPECTRE server.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service serves the SPECTRE service API.
func NewService ¶
NewService returns a SPECTRE server that keeps mirror states and divergences in store, and lists the states received within ttl.
func (*Service) ClearDivergences ¶
func (s *Service) ClearDivergences(ctx context.Context, request *pb.ClearDivergencesRequest) (*pb.ClearDivergencesResponse, error)
ClearDivergences removes the divergences of one service environment.
func (*Service) ListDivergences ¶
func (s *Service) ListDivergences(ctx context.Context, request *pb.ListDivergencesRequest) (*pb.ListDivergencesResponse, error)
ListDivergences returns the states of the mirrors that sent an update within the TTL, and every recorded divergence.
func (*Service) Update ¶ added in v0.47.0
func (s *Service) Update(ctx context.Context, updates spectrepbconnect.SpectreServiceUpdateServerStream) (*pb.UpdateResponse, error)
Update keeps the state a mirror streams. Every message stores the whole state, which keeps it listed, and records the divergence of each quarantine.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client calls the SPECTRE server.
|
Package client calls the SPECTRE server. |
|
Package reporter streams what a mirror sends the SPECTRE server over one stream.
|
Package reporter streams what a mirror sends the SPECTRE server over one stream. |
|
Package storage keeps the states that mirrors report to the SPECTRE server.
|
Package storage keeps the states that mirrors report to the SPECTRE server. |
|
Package wire converts between the SPECTRE service protocol and the domain model, so only the server's API boundary handles protocol messages.
|
Package wire converts between the SPECTRE service protocol and the domain model, so only the server's API boundary handles protocol messages. |