Documentation ¶
Overview ¶
Package service wraps coreos/raft library.
Index ¶
- Variables
- type Config
- type Service
- func (s *Service) AddToGRPCServer(gs *grpc.Server)
- func (s *Service) Config() interface{}
- func (s *Service) Desc() string
- func (s *Service) Expose() interface{}
- func (s *Service) ID() string
- func (s *Service) Name() string
- func (s *Service) Needs() map[string]struct{}
- func (s *Service) Plug(exposed map[string]interface{}) error
- func (s *Service) Run(ctx context.Context, running, stopping func()) error
- func (s *Service) SetConfig(config interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotHost is returned when the connected service is not a host. ErrNotHost = errors.New("connected service is not a host") // ErrNotSwarm is returned when the connected service is not a swarm. ErrNotSwarm = errors.New("connected service is not a swarm") )
View Source
var ( // available. ErrUnavailable = errors.New("the service is not available") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ElectionTick is the number of Node.Tick invocations that must pass between elections ElectionTick int `toml:"election_tick" comment:"the number of Node.Tick invocations that must pass between elections"` // HeartbeatTick is the number of Node.Tick invocations that must pass between heartbeats HeartbeatTick int `toml:"heartbeat_tick" comment:"the number of Node.Tick invocations that must pass between heartbeats"` // MaxSizePerMsg limits the max size of each append message MaxSizePerMsg uint64 `toml:"max_size_per_msg" comment:"limits the max size of each append message"` // MaxInflightMsgs limits the max number of in-flight append messages during optimistic replication phase MaxInflightMsgs int `toml:"max_inflight_msgs" comment:"limits the max number of in-flight append messages during optimistic replication phase"` // TickerInterval defines the unit of time in ms TickerInterval uint64 `toml:"ticker_interval" comment:"defines the unit of time in ms"` }
Config contains configuration options for the Raft service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Raft service.
func (*Service) AddToGRPCServer ¶
AddToGRPCServer adds the service to a gRPC server.
func (*Service) Config ¶
func (s *Service) Config() interface{}
Config returns the current service configuration or creates one with good default values.
func (*Service) Expose ¶
func (s *Service) Expose() interface{}
Expose exposes nothing for the moment
Click to show internal directories.
Click to hide internal directories.