Documentation
¶
Index ¶
- Constants
- func KeyFor(group, resource, namespace, name string) string
- func ParseKey(key string) (group, resource, namespace, name string, err error)
- type Lease
- type MemoryStore
- func (s *MemoryStore) Close() error
- func (s *MemoryStore) Compact(beforeRevision int64) error
- func (s *MemoryStore) CurrentRevision() int64
- func (s *MemoryStore) Delete(key string) error
- func (s *MemoryStore) Get(key string) (*StoredObject, error)
- func (s *MemoryStore) List(prefix string) ([]*StoredObject, error)
- func (s *MemoryStore) Put(key string, obj *StoredObject) error
- func (s *MemoryStore) Unwatch(ch <-chan WatchEvent)
- func (s *MemoryStore) Watch(prefix string, sinceRevision int64) (<-chan WatchEvent, error)
- type SQLiteStore
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) Compact(beforeRevision int64) error
- func (s *SQLiteStore) CurrentRevision() int64
- func (s *SQLiteStore) Delete(key string) error
- func (s *SQLiteStore) Get(key string) (*StoredObject, error)
- func (s *SQLiteStore) List(prefix string) ([]*StoredObject, error)
- func (s *SQLiteStore) Put(key string, obj *StoredObject) error
- func (s *SQLiteStore) Unwatch(ch <-chan WatchEvent)
- func (s *SQLiteStore) Watch(prefix string, sinceRevision int64) (<-chan WatchEvent, error)
- type Store
- type StoredObject
- type WatchEvent
Constants ¶
View Source
const ( EventAdded = "ADDED" EventModified = "MODIFIED" EventDeleted = "DELETED" EventBookmark = "BOOKMARK" EventError = "ERROR" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Close ¶
func (s *MemoryStore) Close() error
func (*MemoryStore) Compact ¶
func (s *MemoryStore) Compact(beforeRevision int64) error
func (*MemoryStore) CurrentRevision ¶
func (s *MemoryStore) CurrentRevision() int64
func (*MemoryStore) Delete ¶
func (s *MemoryStore) Delete(key string) error
func (*MemoryStore) Get ¶
func (s *MemoryStore) Get(key string) (*StoredObject, error)
func (*MemoryStore) List ¶
func (s *MemoryStore) List(prefix string) ([]*StoredObject, error)
func (*MemoryStore) Put ¶
func (s *MemoryStore) Put(key string, obj *StoredObject) error
func (*MemoryStore) Unwatch ¶
func (s *MemoryStore) Unwatch(ch <-chan WatchEvent)
func (*MemoryStore) Watch ¶
func (s *MemoryStore) Watch(prefix string, sinceRevision int64) (<-chan WatchEvent, error)
type SQLiteStore ¶ added in v0.11.0
type SQLiteStore struct {
// contains filtered or unexported fields
}
func NewSQLiteStore ¶ added in v0.11.0
func NewSQLiteStore(path string) (*SQLiteStore, error)
func (*SQLiteStore) Close ¶ added in v0.11.0
func (s *SQLiteStore) Close() error
func (*SQLiteStore) Compact ¶ added in v0.11.0
func (s *SQLiteStore) Compact(beforeRevision int64) error
func (*SQLiteStore) CurrentRevision ¶ added in v0.11.0
func (s *SQLiteStore) CurrentRevision() int64
func (*SQLiteStore) Delete ¶ added in v0.11.0
func (s *SQLiteStore) Delete(key string) error
func (*SQLiteStore) Get ¶ added in v0.11.0
func (s *SQLiteStore) Get(key string) (*StoredObject, error)
func (*SQLiteStore) List ¶ added in v0.11.0
func (s *SQLiteStore) List(prefix string) ([]*StoredObject, error)
func (*SQLiteStore) Put ¶ added in v0.11.0
func (s *SQLiteStore) Put(key string, obj *StoredObject) error
func (*SQLiteStore) Unwatch ¶ added in v0.11.0
func (s *SQLiteStore) Unwatch(ch <-chan WatchEvent)
func (*SQLiteStore) Watch ¶ added in v0.11.0
func (s *SQLiteStore) Watch(prefix string, sinceRevision int64) (<-chan WatchEvent, error)
type Store ¶
type Store interface {
Get(key string) (*StoredObject, error)
Put(key string, obj *StoredObject) error
Delete(key string) error
List(prefix string) ([]*StoredObject, error)
Watch(prefix string, sinceRevision int64) (<-chan WatchEvent, error)
Unwatch(ch <-chan WatchEvent)
CurrentRevision() int64
Compact(beforeRevision int64) error
Close() error
}
type StoredObject ¶
type StoredObject struct {
Key string `json:"key"`
Value json.RawMessage `json:"value"`
Revision int64 `json:"revision"`
ModRevision int64 `json:"mod_revision"`
CreateRevision int64 `json:"create_revision"`
Version int64 `json:"version"`
Lease int64 `json:"lease,omitempty"`
Deleted bool `json:"deleted,omitempty"`
}
type WatchEvent ¶
type WatchEvent struct {
Type string `json:"type"`
Object *StoredObject `json:"object"`
}
Click to show internal directories.
Click to hide internal directories.