Versions in this module Expand all Collapse all v1 v1.12.0 Jul 26, 2016 Changes in this version + const DefaultClusterName + const MaxChangesPerTransaction + const MaxTransactionBytes + var All byAll + var ErrExist = errors.New("object already exists") + var ErrInvalidFindBy = errors.New("invalid find argument type") + var ErrNameConflict = errors.New("name conflicts with an existing object") + var ErrNotExist = errors.New("object does not exist") + var ErrSequenceConflict = errors.New("update out of sequence") + func Apply(store *MemoryStore, item events.Event) (err error) + func CreateCluster(tx Tx, c *api.Cluster) error + func CreateNetwork(tx Tx, n *api.Network) error + func CreateNode(tx Tx, n *api.Node) error + func CreateService(tx Tx, s *api.Service) error + func CreateTask(tx Tx, t *api.Task) error + func DeleteCluster(tx Tx, id string) error + func DeleteNetwork(tx Tx, id string) error + func DeleteNode(tx Tx, id string) error + func DeleteService(tx Tx, id string) error + func DeleteTask(tx Tx, id string) error + func FindClusters(tx ReadTx, by By) ([]*api.Cluster, error) + func FindNetworks(tx ReadTx, by By) ([]*api.Network, error) + func FindNodes(tx ReadTx, by By) ([]*api.Node, error) + func FindServices(tx ReadTx, by By) ([]*api.Service, error) + func FindTasks(tx ReadTx, by By) ([]*api.Task, error) + func GetCluster(tx ReadTx, id string) *api.Cluster + func GetNetwork(tx ReadTx, id string) *api.Network + func GetNode(tx ReadTx, id string) *api.Node + func GetService(tx ReadTx, id string) *api.Service + func GetTask(tx ReadTx, id string) *api.Task + func UpdateCluster(tx Tx, c *api.Cluster) error + func UpdateNetwork(tx Tx, n *api.Network) error + func UpdateNode(tx Tx, n *api.Node) error + func UpdateService(tx Tx, s *api.Service) error + func UpdateTask(tx Tx, t *api.Task) error + func ViewAndWatch(store *MemoryStore, cb func(ReadTx) error, specifiers ...state.Event) (watch chan events.Event, cancel func(), err error) + type Batch struct + func (batch *Batch) Update(cb func(Tx) error) error + type By interface + func ByCN(name string) By + func ByDesiredState(state api.TaskState) By + func ByIDPrefix(idPrefix string) By + func ByMembership(membership api.NodeSpec_Membership) By + func ByName(name string) By + func ByNamePrefix(namePrefix string) By + func ByNodeID(nodeID string) By + func ByRole(role api.NodeRole) By + func ByServiceID(serviceID string) By + func BySlot(serviceID string, slot uint64) By + func Or(bys ...By) By + type MemoryStore struct + func NewMemoryStore(proposer state.Proposer) *MemoryStore + func (s *MemoryStore) ApplyStoreActions(actions []*api.StoreAction) error + func (s *MemoryStore) Batch(cb func(*Batch) error) (int, error) + func (s *MemoryStore) Restore(snapshot *pb.StoreSnapshot) error + func (s *MemoryStore) Save(tx ReadTx) (*pb.StoreSnapshot, error) + func (s *MemoryStore) Update(cb func(Tx) error) error + func (s *MemoryStore) View(cb func(ReadTx)) + func (s *MemoryStore) WatchQueue() *watch.Queue + type Object interface + Copy func() Object + EventCreate func() state.Event + EventDelete func() state.Event + EventUpdate func() state.Event + ID func() string + Meta func() api.Meta + SetMeta func(api.Meta) + type ObjectStoreConfig struct + ApplyStoreAction func(Tx, *api.StoreAction) error + Name string + NewStoreAction func(state.Event) (api.StoreAction, error) + Restore func(Tx, *api.StoreSnapshot) error + Save func(ReadTx, *api.StoreSnapshot) error + Table *memdb.TableSchema + type ReadTx interface + type Tx interface