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 cache or cache candidate
Delete(ctx context.Context, name string) error
// check if cache instance exists
Exists(ctx context.Context, name string) (bool, error)
// create a candidate
CreateCandidate(ctx context.Context, name, candidate, owner string, priority int32) error
// get list of candidates
GetCandidates(ctx context.Context, name string) ([]*cache.CandidateDetails, error)
// check if a candidate exists
HasCandidate(ctx context.Context, name, candidate string) (bool, error)
// deletes a candidate
DeleteCandidate(ctx context.Context, name, candidate string) error
// clone a cache
Clone(ctx context.Context, name, clone string) error
//
CreatePruneID(ctx context.Context, name string, force bool) (string, error)
//
ApplyPrune(ctx context.Context, name, id string) error
// 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
// 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
// get changes 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
// build a cache update from a sdcpb.Update
NewUpdate(*sdcpb.Update) (*Update, error)
// disconnect from the cache
Close() error
}
func NewLocalCache ¶
func NewLocalCache(cfg *config.CacheConfig) (Client, error)
Click to show internal directories.
Click to hide internal directories.