database

package
v0.0.0-...-9b8e8df Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMigrationFailedStr = "database migration failed" //nolint:gochecknoglobals

ErrMigrationFailedStr is returned if migration was failed and db returned to the previous state.

View Source
var ErrNotExistStr = "entry doesn't exist" //nolint:gochecknoglobals

ErrNotExistStr is returned when requested entry not exist in DB.

Functions

This section is empty.

Types

type Database

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

Database structure with database information.

func New

func New(name string, migrationPath string, mergedMigrationPath string) (db *Database, err error)

New creates new database handle.

func (*Database) Close

func (db *Database) Close()

Close closes database.

func (*Database) GetAosVersion

func (db *Database) GetAosVersion(id string) (version uint64, err error)

GetAosVersion returns module Aos version.

func (*Database) GetModuleState

func (db *Database) GetModuleState(id string) (state []byte, err error)

GetModuleState returns module state.

func (*Database) GetUpdateState

func (db *Database) GetUpdateState() (state []byte, err error)

GetUpdateState returns update state.

func (*Database) SetAosVersion

func (db *Database) SetAosVersion(id string, version uint64) (err error)

SetAosVersion sets module Aos version.

func (*Database) SetModuleState

func (db *Database) SetModuleState(id string, state []byte) (err error)

SetModuleState sets module state.

func (*Database) SetUpdateState

func (db *Database) SetUpdateState(state []byte) (err error)

SetUpdateState stores update state.

Jump to

Keyboard shortcuts

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