Documentation ¶
Index ¶
- type Config
- type KeyValueStore
- func (kvs *KeyValueStore) CallableByJS() []string
- func (kvs *KeyValueStore) Get(key string) any
- func (kvs *KeyValueStore) Init() error
- func (kvs *KeyValueStore) InjectJS() string
- func (kvs *KeyValueStore) Name() string
- func (kvs *KeyValueStore) Save() error
- func (kvs *KeyValueStore) Set(key string, value any) error
- func (kvs *KeyValueStore) Shutdown()
- type Plugin
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 NewPlugin ¶
func NewPlugin(config *Config) *KeyValueStore
func (*KeyValueStore) CallableByJS ¶
func (kvs *KeyValueStore) CallableByJS() []string
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) Init ¶
func (kvs *KeyValueStore) Init() error
Init is called when the plugin is loaded. It is passed the application.App instance. This is where you should do any setup.
func (*KeyValueStore) InjectJS ¶
func (kvs *KeyValueStore) InjectJS() string
func (*KeyValueStore) Name ¶
func (kvs *KeyValueStore) Name() string
Name returns the name of the plugin.
func (*KeyValueStore) Set ¶
func (kvs *KeyValueStore) Set(key string, value any) error
Set sets the value for the given key. If AutoSave is true, the store is saved to disk.
func (*KeyValueStore) Shutdown ¶
func (kvs *KeyValueStore) Shutdown()
Shutdown will save the store to disk if there are unsaved changes.
Click to show internal directories.
Click to hide internal directories.