database

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 12 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 BugRecord

type BugRecord struct {
	ID                  string      `json:"id"`
	AgentID             string      `json:"agent_id"`
	Level               string      `json:"level"`
	Hash                string      `json:"hash"`
	Full                interface{} `json:"full"`
	TimesReported       string      `json:"times_reported"`
	TimesReportedNumber int         `json:"times_reported_number" dynamodbav:"-"`
}

type BugStorage

type BugStorage struct {
	Database Database
}

func NewBugStorage

func NewBugStorage(d Database) *BugStorage

func (BugStorage) Find

func (b BugStorage) Find(data BugRecord) ([]BugRecord, error)

func (BugStorage) FindAndStore

func (b BugStorage) FindAndStore(data BugRecord) (BugRecord, error)

func (BugStorage) Insert

func (b BugStorage) Insert(data BugRecord) error

func (BugStorage) Store

func (b BugStorage) Store(data BugRecord) error

func (BugStorage) Update

func (b BugStorage) Update(data BugRecord) error

type CommsCredentials

type CommsCredentials struct {
	AgentID      string      `json:"agent_id"`
	CommsDetails interface{} `json:"comms_details"`
	System       string      `json:"system"`
}

type CommsStorage

type CommsStorage struct {
	Database Database
}

func NewCommsStorage

func NewCommsStorage(d Database) *CommsStorage

func (CommsStorage) FetchCredentials

func (c CommsStorage) FetchCredentials(agentID string) (CommsCredentials, error)

type Database

type Database struct {
	Config config.Config
	Logger *zap.SugaredLogger
}

func New

type Storage

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

type TicketDetails

type TicketDetails struct {
	ID       string `json:"id"`
	AgentID  string `json:"agent_id"`
	RemoteID string `json:"remote_id"`
	System   string `json:"system"`
	Hash     string `json:"hash"`
}

type TicketingCredentials

type TicketingCredentials struct {
	AgentID          string      `json:"agent_id"`
	AccessToken      string      `json:"access_token"`
	TicketingDetails interface{} `json:"ticketing_details"`
	System           string      `json:"system"`
}

type TicketingStorage

type TicketingStorage struct {
	Database Database
}

func NewTicketingStorage

func NewTicketingStorage(d Database) *TicketingStorage

func (TicketingStorage) FetchCredentials

func (t TicketingStorage) FetchCredentials(agentID string) (TicketingCredentials, error)

func (TicketingStorage) FindTicket

func (t TicketingStorage) FindTicket(details TicketDetails) (TicketDetails, error)

func (TicketingStorage) StoreCredentials

func (t TicketingStorage) StoreCredentials(credentials TicketingCredentials) error

func (TicketingStorage) StoreTicketDetails

func (t TicketingStorage) StoreTicketDetails(details TicketDetails) error

func (TicketingStorage) TicketExists

func (t TicketingStorage) TicketExists(details TicketDetails) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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