database

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountLevelDeity = iota
	AccountLevelOwner
	AccountLevelSub
)

Variables

This section is empty.

Functions

func GetAccountLevel

func GetAccountLevel(level string) int

Types

type AccountCredentials

type AccountCredentials struct {
	Key    string `json:"key"`
	Secret string `json:"secret"`
}

type AccountRecord

type AccountRecord struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	ParentID string `json:"parent_id"`
	Email    string `json:"email"`
	AccountCredentials
	Level       int    `json:"level"`
	DateCreated string `json:"date_created"`
}

type AccountStorage

type AccountStorage struct {
	Database Database
}

func NewAccountStorage

func NewAccountStorage(d Database) *AccountStorage

func (AccountStorage) Delete

func (a AccountStorage) Delete(id string) error

func (AccountStorage) Fetch

func (a AccountStorage) Fetch(id string) (AccountRecord, error)

func (AccountStorage) Insert

func (a AccountStorage) Insert(data AccountRecord) error

type AgentCredentials

type AgentCredentials struct {
	Key    string `json:"key"`
	Secret string `json:"secret"`
}

type AgentRecord

type AgentRecord struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	AgentCredentials
	AccountRecord
}

type AgentStorage

type AgentStorage struct {
	Database Database
}

func NewAgentStorage

func NewAgentStorage(d Database) *AgentStorage

func (AgentStorage) Delete

func (a AgentStorage) Delete(id string) error

func (AgentStorage) Fetch

func (a AgentStorage) Fetch(id string) (AgentRecord, error)

func (AgentStorage) Insert

func (a AgentStorage) Insert(data AgentRecord) error

type Database

type Database struct {
	Config config.Config
}

func New

func New(c config.Config) *Database

type LogRecord added in v0.6.0

type LogRecord struct {
	ID         string    `json:"id"`
	AgentID    string    `json:"agent_id"`
	Level      string    `json:"level"`
	Line       string    `json:"line"`
	File       string    `json:"file"`
	Stack      string    `json:"stack"`
	LogFmt     string    `json:"log_fmt"`
	Entry      string    `json:"entry"`
	LoggedTime time.Time `json:"logged_time" dynamodbav:"-"`
	Logged     string    `json:"logged"`
}

type LogStorage added in v0.6.0

type LogStorage struct {
	Database Database
}

func NewLogStorage added in v0.6.0

func NewLogStorage(d Database) *LogStorage

func (LogStorage) Store added in v0.6.0

func (l LogStorage) Store(data LogRecord) error

type Storage

type Storage interface {
	Insert(data interface{}) error
	Fetch(data interface{}) (interface{}, error)
	Delete(data interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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