Documentation
¶
Index ¶
- Constants
- func NewMeshStateMachine(shardID, replicaID uint64) statemachine.IStateMachine
- type ApplyLawsPayload
- type Client
- func (c *Client) BroadcastCommand(ctx context.Context, cmd Command) (map[uint64]*CommandResult, error)
- func (c *Client) ExecuteCommand(ctx context.Context, cmd Command) (*CommandResult, error)
- func (c *Client) GetNodes(ctx context.Context) ([]Node, error)
- func (c *Client) GetStatus(ctx context.Context) (*MeshStatus, error)
- type Command
- type CommandResult
- type CommandType
- type Config
- type ExecPayload
- type ExecResult
- type FactsPayload
- type HTTPServer
- type MeshService
- type MeshStateMachine
- func (m *MeshStateMachine) Close() error
- func (m *MeshStateMachine) Lookup(query interface{}) (interface{}, error)
- func (m *MeshStateMachine) RecoverFromSnapshot(r io.Reader, files []statemachine.SnapshotFile, done <-chan struct{}) error
- func (m *MeshStateMachine) SaveSnapshot(w io.Writer, fc statemachine.ISnapshotFileCollection, done <-chan struct{}) error
- func (m *MeshStateMachine) StoreResult(result *CommandResult)
- func (m *MeshStateMachine) Update(entry statemachine.Entry) (statemachine.Result, error)
- type MeshStatus
- type Node
- type Service
- func (s *Service) BroadcastCommand(ctx context.Context, cmd Command) (map[uint64]*CommandResult, error)
- func (s *Service) ExecuteCommand(ctx context.Context, cmd Command) (*CommandResult, error)
- func (s *Service) GetNodes() ([]Node, error)
- func (s *Service) GetStatus() (*MeshStatus, error)
- func (s *Service) Start(ctx context.Context) error
- func (s *Service) Stop() error
Constants ¶
View Source
const (
DefaultShardID = 1
)
Variables ¶
This section is empty.
Functions ¶
func NewMeshStateMachine ¶
func NewMeshStateMachine(shardID, replicaID uint64) statemachine.IStateMachine
Types ¶
type ApplyLawsPayload ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BroadcastCommand ¶
func (*Client) ExecuteCommand ¶
type Command ¶
type Command struct {
ID string `json:"id"`
Type CommandType `json:"type"`
Payload json.RawMessage `json:"payload"`
Metadata map[string]string `json:"metadata,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
type CommandResult ¶
type CommandType ¶
type CommandType string
const ( CommandTypeExec CommandType = "exec" CommandTypeFacts CommandType = "facts" CommandTypeApplyLaws CommandType = "apply_laws" )
type ExecPayload ¶
type ExecResult ¶
type FactsPayload ¶
type FactsPayload struct {
Categories []string `json:"categories,omitempty"`
}
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewHTTPServer(service *Service, addr string, logger zerolog.Logger) *HTTPServer
func (*HTTPServer) Start ¶
func (h *HTTPServer) Start() error
type MeshService ¶
type MeshStateMachine ¶
type MeshStateMachine struct {
ShardID uint64
ReplicaID uint64
// contains filtered or unexported fields
}
func (*MeshStateMachine) Close ¶
func (m *MeshStateMachine) Close() error
func (*MeshStateMachine) Lookup ¶
func (m *MeshStateMachine) Lookup(query interface{}) (interface{}, error)
func (*MeshStateMachine) RecoverFromSnapshot ¶
func (m *MeshStateMachine) RecoverFromSnapshot(r io.Reader, files []statemachine.SnapshotFile, done <-chan struct{}) error
func (*MeshStateMachine) SaveSnapshot ¶
func (m *MeshStateMachine) SaveSnapshot(w io.Writer, fc statemachine.ISnapshotFileCollection, done <-chan struct{}) error
func (*MeshStateMachine) StoreResult ¶
func (m *MeshStateMachine) StoreResult(result *CommandResult)
func (*MeshStateMachine) Update ¶
func (m *MeshStateMachine) Update(entry statemachine.Entry) (statemachine.Result, error)
type MeshStatus ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) BroadcastCommand ¶
func (*Service) ExecuteCommand ¶
func (*Service) GetStatus ¶
func (s *Service) GetStatus() (*MeshStatus, error)
Click to show internal directories.
Click to hide internal directories.