camDatabase

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseComponent

type DatabaseComponent struct {
	component.Component
	camStatics.DatabaseComponentInterface
	// contains filtered or unexported fields
}

database component

func (*DatabaseComponent) GetDSN

func (comp *DatabaseComponent) GetDSN() string

get data source name. [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]

func (*DatabaseComponent) GetEngine

func (comp *DatabaseComponent) GetEngine() *xorm.Engine

get xorm engine

func (*DatabaseComponent) Init

init

func (*DatabaseComponent) NewSession

func (comp *DatabaseComponent) NewSession() *xorm.Session

new session

func (*DatabaseComponent) Start

func (comp *DatabaseComponent) Start()

start

func (*DatabaseComponent) Stop

func (comp *DatabaseComponent) Stop()

stop

type DatabaseComponentConfig

type DatabaseComponentConfig struct {
	component.ComponentConfig

	DriverName string // driver name. Example: "mysql", "sqlite"
	Host       string // database hostname
	Port       string // database port
	Name       string // database name
	Username   string // username
	Password   string // password
}

database config

func NewDatabaseComponentConfig

func NewDatabaseComponentConfig(driverName string, host string, port string, name string, username string, password string) *DatabaseComponentConfig

new instance

Jump to

Keyboard shortcuts

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