Documentation
¶
Overview ¶
Package server is the SPECTRE server, which collects the heartbeats that mirrors send. 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, request *pb.UpdateRequest) (*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 `default:"90s" help:"How long a mirror's state is listed after its last heartbeat. Keep it above the heartbeat interval."`
}
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 a heartbeat within the TTL, and every recorded divergence.
func (*Service) Update ¶ added in v0.47.0
func (s *Service) Update(ctx context.Context, request *pb.UpdateRequest) (*pb.UpdateResponse, error)
Update records the latest state of a mirror, and the divergence of each of its quarantines.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client calls the SPECTRE server.
|
Package client calls the SPECTRE server. |
|
Package reporter sends a mirror's heartbeats to the SPECTRE server.
|
Package reporter sends a mirror's heartbeats to the SPECTRE server. |
|
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. |