Documentation ¶
Index ¶
- type DatabaseComponent
- func (comp *DatabaseComponent) GetDSN() string
- func (comp *DatabaseComponent) GetEngine() *xorm.Engine
- func (comp *DatabaseComponent) Init(configI camStatics.ComponentConfigInterface)
- func (comp *DatabaseComponent) NewSession() *xorm.Session
- func (comp *DatabaseComponent) Start()
- func (comp *DatabaseComponent) Stop()
- type DatabaseComponentConfig
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&...¶mN=valueN]
func (*DatabaseComponent) GetEngine ¶
func (comp *DatabaseComponent) GetEngine() *xorm.Engine
get xorm engine
func (*DatabaseComponent) Init ¶
func (comp *DatabaseComponent) Init(configI camStatics.ComponentConfigInterface)
init
func (*DatabaseComponent) NewSession ¶
func (comp *DatabaseComponent) NewSession() *xorm.Session
new session
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
Click to show internal directories.
Click to hide internal directories.