database

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: May 5, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

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
}

A DB stores awless config, logs...

func (*DB) AddHistoryCommand

func (db *DB) AddHistoryCommand(command []string) error

AddHistoryCommand adds a command to history in database

func (*DB) AddHistoryCommandWithTime

func (db *DB) AddHistoryCommandWithTime(command []string, time time.Time) error

AddHistoryCommandWithTime adds a command to history in database where time can be set

func (*DB) AddLog

func (db *DB) AddLog(msg string) error

func (*DB) AddTemplate

func (db *DB) AddTemplate(templ *template.Template) 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) DeleteHistory

func (db *DB) DeleteHistory() error

DeleteHistory empties the history from database

func (*DB) DeleteLogs

func (db *DB) DeleteLogs() error

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) GetHistory

func (db *DB) GetHistory(fromID int) ([]*line, error)

GetHistory gets the history from database

func (*DB) GetIntValue

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

GetIntValue gets a int value from database

func (*DB) GetLogs

func (db *DB) GetLogs() (logs []*Log, err 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.Template, 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
	Tpl      *template.Template
	Key, Raw string
}

type Log

type Log struct {
	Msg  string
	Hits int
	Date time.Time
}

A Log represents a log of an error that occurred in awless

Jump to

Keyboard shortcuts

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