components

package
v0.0.0-...-3cf2f40 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineConnection

func DetermineConnection(d *appconfig.DbSettings) string

func InitLogger

func InitLogger(service string)

InitLogger initialises and caches the logging server will send warning and above messages to Discord if the DISCORD_LOGGING_WEBHOOK_URL environment variable is set

Types

type DB

type DB interface {
	// --- Quick lookup if invoice exists -------------------------------------------------------------------
	FindInvoice(invoice string) (string, error)
	// --- Add new invoice ----------------------------------------------------------------------------------
	AddInvoice(username string, invoice string, pkg string, purdate string, email string) (string, error)
	// --- Remove invoice from user -------------------------------------------------------------------------
	DeleteInvoice(invoice string) (string, error)
	// --- Search and return invoice details ----------------------------------------------------------------
	SearchInvoice(invoice string) (string, error)
	// --- Search and return user details -------------------------------------------------------------------
	SearchUser(username string) (string, error)
	// --- Initial DB setup ---------------------------------------------------------------------------------
	DbSetup(setup bool) (bool, string, error)
	// --- Ensure that all migrations are done --------------------------------------------------------------
	Ensure() error
	// --- Run db mainloop ----------------------------------------------------------------------------------
	Run()
	// --- Close access to database -------------------------------------------------------------------------
	Close() error
}

type DbConfig

type DbConfig struct {
	Db   *appconfig.DbSettings
	Xorm *XormDB
}

func (*DbConfig) ConnectDB

func (xdb *DbConfig) ConnectDB(d *appconfig.DbSettings) *DbConfig

type XormDB

type XormDB struct {
	Engine *xorm.Engine
	// contains filtered or unexported fields
}

func (*XormDB) Close

func (x *XormDB) Close() (err error)

func (*XormDB) Run

func (x *XormDB) Run()

Jump to

Keyboard shortcuts

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