Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// Create a cache
Create(ctx context.Context, name string, ephemeral bool, cached bool) error
// List caches
List(ctx context.Context) ([]string, error)
// Delete delete cache or cache candidate
Delete(ctx context.Context, name string) error
// Exists check if cache instance exists
Exists(ctx context.Context, name string) (bool, error)
// CreateCandidate create a candidate
CreateCandidate(ctx context.Context, name, candidate, owner string, priority int32) error
// GetCandidates get list of candidates
GetCandidates(ctx context.Context, name string) ([]*cache.CandidateDetails, error)
// HasCandidate check if a candidate exists
HasCandidate(ctx context.Context, name, candidate string) (bool, error)
// DeleteCandidate deletes a candidate
DeleteCandidate(ctx context.Context, name, candidate string) error
// Clone a cache
Clone(ctx context.Context, name, clone string) error
// CreatePruneID
CreatePruneID(ctx context.Context, name string, force bool) (string, error)
// ApplyPrune
ApplyPrune(ctx context.Context, name, id string) error
// Modify send a stream of modifications (update or delete) to a cache, or candidate
Modify(ctx context.Context, name string, opts *Opts, dels [][]string, upds []*Update) error
// Read from a cache or candidate
Read(ctx context.Context, name string, opts *Opts, paths [][]string, period time.Duration) []*Update
// ReadCh read from a cache or candidate, get results through a channel
ReadCh(ctx context.Context, name string, opts *Opts, paths [][]string, period time.Duration) chan *Update
// GetChanges present in a candidate
GetChanges(ctx context.Context, name, candidate string) ([]*Change, error)
// Discard changes made to a candidate
Discard(ctx context.Context, name, candidate string) error
// Commit a candidate changes into the intended store
Commit(ctx context.Context, name, candidate string) error
// NewUpdate build a cache update from a sdcpb.Update
NewUpdate(*sdcpb.Update) (*Update, error)
// GetKeys retrieve the Keys of the specified store
GetKeys(ctx context.Context, name string, store cachepb.Store) (chan *Update, error)
// disconnect from the cache
Close() error
}
func NewLocalCache ¶
func NewLocalCache(cfg *config.CacheConfig) (Client, error)
type IntentMeta ¶ added in v0.0.39
type KeyData ¶ added in v0.0.39
type KeyData struct {
Path []string
Intents []IntentMeta
}
type Update ¶
type Update struct {
// contains filtered or unexported fields
}
func (*Update) EqualSkipPath ¶ added in v0.0.39
EqualSkipPath checks the equality of two updates. It however skips comparing paths and timestamps. This is a shortcut for performace, for cases in which it is already clear that the path is definately equal.
Click to show internal directories.
Click to hide internal directories.