Versions in this module Expand all Collapse all v0 v0.1.0 Sep 12, 2023 Changes in this version + var ErrEmptyKey = errors.New("key may not be empty") + type Cache interface + type CacheWriter interface + Set func(ctx context.Context, key Key, state []byte) error + type DB struct + Plugins Plugins + State Store + func NewDB(ctx context.Context, stateFilePath string) (*DB, error) + func (db *DB) Close() error + type EntPluginsRepo struct + func NewEntPluginsRepo(client *ent.Client) *EntPluginsRepo + func (e EntPluginsRepo) List(ctx context.Context) ([]Plugin, error) + func (e EntPluginsRepo) ModulesForPlugin(ctx context.Context, id uuid.UUID) ([]PluginModule, error) + func (e EntPluginsRepo) Remove(ctx context.Context, id uuid.UUID) error + func (e EntPluginsRepo) UpsertModules(ctx context.Context, modules []PluginModule) error + func (e EntPluginsRepo) UpsertPlugin(ctx context.Context, p Plugin) (pluginID uuid.UUID, err error) + type EntStateRepository struct + func NewEntStore(ctx context.Context, client *ent.Client) (*EntStateRepository, error) + func (s *EntStateRepository) Get(ctx context.Context, key Key) (state []byte, meta Metadata, err error) + func (s *EntStateRepository) Set(ctx context.Context, key Key, state []byte, opts ...EntryOption) error + type EntryOption interface + func WithTTL(ttl time.Duration) EntryOption + type EntryOptionFunc func(e *ent.KVEntryCreate) + type InMemoryStore struct + func (i *InMemoryStore) Get(ctx context.Context, key Key) (state []byte, meta Metadata, err error) + func (i *InMemoryStore) Set(_ context.Context, key Key, state []byte, opts ...EntryOption) error + type Key interface + Bytes func() []byte + type Metadata struct + ModifiedAt time.Time + TTL *time.Time + type PlainKey []byte + func (k PlainKey) Bytes() []byte + type Plugin struct + Hash []byte + ID *uuid.UUID + LocalPath string + Name string + URL *url.URL + type PluginModule struct + Category commonv1.Category + DefaultSpec []byte + ID *uuid.UUID + PluginID uuid.UUID + Type string + type Plugins interface + List func(ctx context.Context) ([]Plugin, error) + ModulesForPlugin func(ctx context.Context, id uuid.UUID) ([]PluginModule, error) + Remove func(ctx context.Context, id uuid.UUID) error + UpsertModules func(ctx context.Context, modules []PluginModule) error + UpsertPlugin func(ctx context.Context, plugin Plugin) (pluginID uuid.UUID, err error) + type StateCache struct + Store Store + TTL time.Duration + func NewStateCache(ttl time.Duration, store Store) *StateCache + func (s *StateCache) Get(ctx context.Context, key Key) (state []byte, meta Metadata, err error) + func (s *StateCache) Set(ctx context.Context, key Key, state []byte) error + type Store interface + type StoreReader interface + Get func(ctx context.Context, key Key) (state []byte, meta Metadata, err error) + type StoreWriter interface + Set func(ctx context.Context, key Key, state []byte, opts ...EntryOption) error + type StringsKey []string + func KeyOfStrings(parts ...any) StringsKey + func (k StringsKey) Bytes() []byte