Versions in this module Expand all Collapse all v0 v0.1.0 Mar 12, 2021 Changes in this version + type Batch struct + RemoveKeys []string + SaveKeys []string + SaveValues []string + type KV interface + AllocID func() (uint64, error) + Batch func(batch *Batch) error + CountRange func(key, endKey string) (uint64, error) + Load func(key string) (string, error) + LoadRange func(key, endKey string, limit int64) ([]string, []string, error) + Remove func(key string) error + RemoveIfValueMatched func(key string, expect string) (bool, error) + Save func(key, value string) error + SaveIfNotExists func(key string, value string, batch *Batch) (bool, string, error) + func NewEtcdKV(rootPath string, client *clientv3.Client, leadship *election.Leadership) KV + type Storage interface + AlreadyBootstrapped func() (bool, error) + GetContainer func(id uint64) (metadata.Container, error) + GetResource func(id uint64) (metadata.Resource, error) + GetTimestamp func() (time.Time, error) + KV func() KV + LoadAllScheduleConfig func() ([]string, []string, error) + LoadConfig func(cfg interface{}) (bool, error) + LoadContainers func(limit int64, ...) error + LoadResources func(limit int64, do func(metadata.Resource)) error + LoadRuleGroups func(limit int64, f func(k, v string) error) error + LoadRules func(limit int64, f func(k, v string) error) error + LoadScheduleConfig func(scheduleName string) (string, error) + PutBootstrapped func(container metadata.Container, resources ...metadata.Resource) (bool, error) + PutContainer func(meta metadata.Container) error + PutContainerWeight func(id uint64, leaderWeight, resourceWeight float64) error + PutResource func(meta metadata.Resource) error + PutRule func(key string, rule interface{}) error + PutRuleGroup func(groupID string, group interface{}) error + PutTimestamp func(time.Time) error + RemoveContainer func(meta metadata.Container) error + RemoveResource func(meta metadata.Resource) error + RemoveRule func(key string) error + RemoveRuleGroup func(groupID string) error + RemoveScheduleConfig func(scheduleName string) error + SaveConfig func(cfg interface{}) error + SaveScheduleConfig func(scheduleName string, data []byte) error + func NewStorage(rootPath string, kv KV, adapter metadata.Adapter) Storage + func NewTestStorage() Storage