rdb

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConnection

func CreateConnection(name, driver, dsn string) (*sql.DB, error)

func CreateConnections

func CreateConnections(config map[string]string) error

func PushDB

func PushDB(name string, db *sql.DB) error

func Register

func Register()

Register register the rdb in io apps

Types

type App

type App struct{}

App settings app struct

func (App) Menus

func (App) Menus() []menu.Menu

Menus setup menus

func (App) Pack

func (App) Pack()

func (App) Permissions

func (App) Permissions() []evo.Permission

Permissions setup permissions of app

func (App) Register

func (App) Register()

Register settings app

func (App) Router

func (App) Router()

Router setup routers

func (App) WhenReady

func (App) WhenReady()

WhenReady called after setup all apps

type Controller

type Controller struct{}

type DBO

type DBO struct {
	Conn    *sql.DB
	Queries map[string]*Query
	Debug   bool
	// contains filtered or unexported fields
}

func GetDBO

func GetDBO(name string) *DBO

func (*DBO) CreateQuery

func (dbo *DBO) CreateQuery(name, query string) *Query

func (*DBO) GetQuery

func (dbo *DBO) GetQuery(name string) *Query

type Param

type Param struct {
	Key        string
	Source     Source
	Validation string
	Default    string
}

type Parser

type Parser struct {
	Params    []Param
	Processor func(params []string) []string
}

func NewParser

func NewParser(params ...Param) *Parser

func (*Parser) Parse

func (parser *Parser) Parse(r *evo.Request) ([]string, error)

type Query

type Query struct {
	QueryString string
	DBO         *DBO
	Parser      *Parser
}

func (*Query) All

func (q *Query) All(out interface{}, params ...interface{}) error

func (*Query) SetParser

func (q *Query) SetParser(parser *Parser)

func (*Query) ToMap

func (q *Query) ToMap(params ...interface{}) ([]map[string]interface{}, error)

type Source

type Source uint8
const (
	Get      Source = 0
	Post     Source = 1
	URL      Source = 3
	Header   Source = 4
	Cookie   Source = 5
	Any      Source = 6
	Constant Source = 7
)

Jump to

Keyboard shortcuts

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