Documentation ¶
Index ¶
- type Config
- type KeyValueStore
- func (kvs *KeyValueStore) Delete(key string) error
- func (kvs *KeyValueStore) Get(key string) any
- func (kvs *KeyValueStore) Name() string
- func (kvs *KeyValueStore) OnShutdown() error
- func (kvs *KeyValueStore) OnStartup(ctx context.Context, options application.ServiceOptions) error
- func (kvs *KeyValueStore) Save() error
- func (kvs *KeyValueStore) Set(key string, value any) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyValueStore ¶
type KeyValueStore struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *Config) *KeyValueStore
func (*KeyValueStore) Delete ¶
func (kvs *KeyValueStore) Delete(key string) error
Delete deletes the key from the store. If AutoSave is true, the store is saved to disk.
func (*KeyValueStore) Get ¶
func (kvs *KeyValueStore) Get(key string) any
Get returns the value for the given key. If key is empty, the entire store is returned.
func (*KeyValueStore) Name ¶
func (kvs *KeyValueStore) Name() string
Name returns the name of the plugin.
func (*KeyValueStore) OnShutdown ¶
func (kvs *KeyValueStore) OnShutdown() error
OnShutdown will save the store to disk if there are unsaved changes.
func (*KeyValueStore) OnStartup ¶
func (kvs *KeyValueStore) OnStartup(ctx context.Context, options application.ServiceOptions) error
OnStartup is called when the plugin is loaded. This is where you should do any setup.
Click to show internal directories.
Click to hide internal directories.