Documentation
¶
Index ¶
- type Config
- type FSM
- func (f *FSM) Apply(log *raft.Log) interface{}
- func (f *FSM) GetFilaments() []*models.Filament
- func (f *FSM) GetPrintJob(id string) (*models.PrintJob, bool)
- func (f *FSM) GetPrintJobs() []*models.PrintJob
- func (f *FSM) GetPrintJobsByStatus(status string) []*models.PrintJob
- func (f *FSM) GetPrinters() []*models.Printer
- func (f *FSM) Restore(rc io.ReadCloser) error
- func (f *FSM) Snapshot() (raft.FSMSnapshot, error)
- type Node
- type Store
- func (s *Store) Backup(w io.Writer) error
- func (s *Store) Close() error
- func (s *Store) Delete(key string) error
- func (s *Store) Get(key string) ([]byte, error)
- func (s *Store) Keys() []string
- func (s *Store) LoadSnapshot() ([]byte, error)
- func (s *Store) LoadState() (raft.Configuration, error)
- func (s *Store) PersistState(state raft.Configuration) error
- func (s *Store) Restore(r io.Reader) error
- func (s *Store) Set(key string, val []byte) error
- func (s *Store) StoreSnapshot(data []byte) error
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
FSM implements the raft.FSM interface for our 3D printing application
func (*FSM) GetFilaments ¶
GetFilaments returns all filaments
func (*FSM) GetPrintJob ¶
GetPrintJob returns a print job by ID
func (*FSM) GetPrintJobs ¶
GetPrintJobs returns all print jobs
func (*FSM) GetPrintJobsByStatus ¶
GetPrintJobsByStatus returns print jobs filtered by status
func (*FSM) GetPrinters ¶
GetPrinters returns all printers
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a node in the Raft cluster
func (*Node) LeaderAddress ¶
LeaderAddress returns the address of the current leader
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides an interface for storing and retrieving Raft data
func (*Store) LoadSnapshot ¶
LoadSnapshot loads the latest snapshot
func (*Store) LoadState ¶
func (s *Store) LoadState() (raft.Configuration, error)
LoadState loads the persisted Raft server configuration
func (*Store) PersistState ¶
func (s *Store) PersistState(state raft.Configuration) error
PersistState persists the Raft server configuration
func (*Store) StoreSnapshot ¶
StoreSnapshot stores a snapshot of the current state
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport provides methods for forwarding requests to the Raft leader
func (*Transport) ForwardToLeader ¶
ForwardToLeader forwards a request to the Raft leader
func (*Transport) JoinCluster ¶
JoinCluster joins a node to the Raft cluster
func (*Transport) LeaveCluster ¶
LeaveCluster removes a node from the Raft cluster
func (*Transport) RaftHandler ¶
RaftHandler returns an HTTP handler for Raft-related operations