Documentation
¶
Overview ¶
Package state persists private accepted state and a bounded acknowledged traffic journal.
Index ¶
- Constants
- func AtomicWrite(path string, b []byte, mode os.FileMode) error
- func ID() string
- type Batch
- type Data
- type Store
- func (s *Store) Accept(c protocol.Config, revision uint64) error
- func (s *Store) Ack(id string) error
- func (s *Store) AddTraffic(delta Traffic) error
- func (s *Store) Authorize(users []protocol.User, revision uint64) error
- func (s *Store) Ban(id int, until time.Time) error
- func (s *Store) Batch() (*Batch, error)
- func (s *Store) BlockIP(key string, block protocol.IPBlock) error
- func (s *Store) Snapshot() Data
- type Traffic
Constants ¶
View Source
const MaxStoreBytes = 64 << 20
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
type Data struct {
AgentID string `json:"agent_id"`
Revision uint64 `json:"revision"`
ConfigRevision uint64 `json:"config_revision"`
Config *protocol.Config `json:"config,omitempty"`
Users []protocol.User `json:"users"`
Bans map[int]time.Time `json:"bans,omitempty"`
IPBlocks map[string]protocol.IPBlock `json:"ip_blocks,omitempty"`
Sequence uint64 `json:"sequence"`
Pending *Batch `json:"pending,omitempty"`
Accumulated Traffic `json:"accumulated,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddTraffic ¶
Click to show internal directories.
Click to hide internal directories.