kvstore

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(api plugin.API, pluginVersion string) (store.Store, error)

NewStore returns a fresh store and upgrades the db from the given schema version.

Types

type PollStore

type PollStore struct {
	// contains filtered or unexported fields
}

PollStore allows to access polls in the KV Store.

func (*PollStore) Delete

func (s *PollStore) Delete(poll *poll.Poll) error

Delete deletes a poll from the KV Store.

func (*PollStore) Get

func (s *PollStore) Get(id string) (*poll.Poll, error)

Get returns the poll for a given id. Returns an error if the poll doesn't exist or a KV Store error occurred.

func (*PollStore) Insert added in v1.4.0

func (s *PollStore) Insert(poll *poll.Poll) error

Insert stores new a poll in the KV Store.

func (*PollStore) Save

func (s *PollStore) Save(poll *poll.Poll) error

Save stores a poll in the KV Store. Overwrittes any existing poll with the same id.

func (*PollStore) Update added in v1.4.0

func (s *PollStore) Update(prev *poll.Poll, new *poll.Poll) error

Update updates an existing a poll in the KV Store.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an interface to interact with the KV Store.

func (*Store) Poll

func (s *Store) Poll() store.PollStore

Poll returns the Poll Store

func (*Store) System

func (s *Store) System() store.SystemStore

System returns the System Store

func (*Store) UpdateDatabase

func (s *Store) UpdateDatabase(pluginVersion string) error

UpdateDatabase upgrades the database schema from a given version to the newest version.

type SystemStore

type SystemStore struct {
	// contains filtered or unexported fields
}

SystemStore allows to access system informations in the KV Store.

func (*SystemStore) GetVersion

func (s *SystemStore) GetVersion() (string, error)

GetVersion returns the db schema version.

func (*SystemStore) SaveVersion

func (s *SystemStore) SaveVersion(version string) error

SaveVersion sets the db schema version.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL