database

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Filename = "awless.db"
)
View Source
const TEMPLATES_BUCKET = "templates"

Variables

This section is empty.

Functions

func Execute added in v0.0.23

func Execute(fn func(*DB) error) error

Types

type DB

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

func (*DB) AddTemplate

func (db *DB) AddTemplate(tplExec *template.TemplateExecution) error

func (*DB) Close

func (db *DB) Close()

Close the database

func (*DB) DeleteBucket

func (db *DB) DeleteBucket(name string) error

DeleteBucket deletes a bucket if it exists

func (*DB) DeleteTemplate added in v0.0.22

func (db *DB) DeleteTemplate(id string) error

func (*DB) DeleteTemplates

func (db *DB) DeleteTemplates() error

func (*DB) GetBytes

func (db *DB) GetBytes(key string) ([]byte, error)

GetBytes gets a []byte value from database

func (*DB) GetConfig

func (db *DB) GetConfig(configsKey, k string) (interface{}, bool)

func (*DB) GetConfigString

func (db *DB) GetConfigString(configsKey, k string) (string, bool)

func (*DB) GetConfigs

func (db *DB) GetConfigs(key string) (configs, error)

func (*DB) GetIntValue

func (db *DB) GetIntValue(key string) (int, error)

GetIntValue gets a int value from database

func (*DB) GetLoadedTemplate added in v0.1.5

func (db *DB) GetLoadedTemplate(id string) (*LoadedTemplate, error)

func (*DB) GetStringValue

func (db *DB) GetStringValue(key string) (string, error)

GetStringValue gets a string value from database

func (*DB) GetTemplate

func (db *DB) GetTemplate(id string) (*template.TemplateExecution, error)

func (*DB) GetTimeValue

func (db *DB) GetTimeValue(key string) (time.Time, error)

GetTimeValue gets a time value from database

func (*DB) ListTemplates

func (db *DB) ListTemplates() ([]*LoadedTemplate, error)

func (*DB) SetBytes

func (db *DB) SetBytes(key string, value []byte) error

SetBytes sets a []byte value in database

func (*DB) SetConfig

func (db *DB) SetConfig(configsKey, k string, v interface{}) error

func (*DB) SetIntValue

func (db *DB) SetIntValue(key string, value int) error

SetIntValue sets a int value in database

func (*DB) SetStringValue

func (db *DB) SetStringValue(key, value string) error

SetStringValue sets a string value in database

func (*DB) SetTimeValue

func (db *DB) SetTimeValue(key string, t time.Time) error

SetTimeValue sets a time value in database

func (*DB) UnsetConfig

func (db *DB) UnsetConfig(configsKey, k string) error

type LoadedTemplate added in v0.0.22

type LoadedTemplate struct {
	Err      error
	TplExec  *template.TemplateExecution
	Key, Raw string
}

Jump to

Keyboard shortcuts

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