database

package
v0.0.0-...-c64e826 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncAuto         = "sync.auto"
	RegionKey        = "region"
	InstanceTypeKey  = "instance.type"
	InstanceImageKey = "instance.image"
	InstanceCountKey = "instance.count"
	ProfileKey       = "aws.profile"
)
View Source
const EXECUTIONS_BUCKET = "executions"

Variables

This section is empty.

Functions

func MustGetDefaultRegion

func MustGetDefaultRegion() string

Types

type DB

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

A DB stores awless config, logs...

func Current

func Current() (*DB, error, func())

func MustGetCurrent

func MustGetCurrent() (*DB, func())

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

func (db *DB) AddTemplateExecution(templ *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) DeleteHistory

func (db *DB) DeleteHistory() error

DeleteHistory empties the history from database

func (*DB) DeleteLogs

func (db *DB) DeleteLogs() error

func (*DB) DeleteTemplateExecutions

func (db *DB) DeleteTemplateExecutions() error

func (*DB) GetBytes

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

GetBytes gets a []byte value from database

func (*DB) GetDefault

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

func (*DB) GetDefaultString

func (db *DB) GetDefaultString(k string) (string, bool)

func (*DB) GetDefaults

func (db *DB) GetDefaults() (defaults, 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) GetTemplateExecution

func (db *DB) GetTemplateExecution(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) ListTemplateExecutions

func (db *DB) ListTemplateExecutions() ([]*template.TemplateExecution, error)

func (*DB) MustGetDefaultRegion

func (db *DB) MustGetDefaultRegion() string

func (*DB) SetBytes

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

SetBytes sets a []byte value in database

func (*DB) SetDefault

func (db *DB) SetDefault(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) UnsetDefault

func (db *DB) UnsetDefault(k string) error

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