Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Database DatabaseConfig `yaml:"Database"`
}
func (*Config) GetDatabase ¶
func (c *Config) GetDatabase() DatabaseConfig
type Database ¶
type Database struct { DbName string // contains filtered or unexported fields }
func NewDatabase ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Host string `yaml:"Host"` Port int `yaml:"Port"` DbName string `yaml:"DbName"` User string `yaml:"User"` Password string `yaml:"Password"` }
func NewDatabaseConfig ¶ added in v0.2.3
func NewDatabaseConfig() *DatabaseConfig
func ParseDatabaseConfig ¶ added in v0.2.3
func ParseDatabaseConfig(args string) (*DatabaseConfig, error)
args ex: host=127.0.0.1;port=3306;dbname=pekomiko;user=user;password=password
type SqlResult ¶
type SqlResult struct { // LastInsertId returns the integer generated by the database // in response to a command. Typically this will be from an // "auto increment" column when inserting a new row. Not all // databases support this feature, and the syntax of such // statements varies. LastInsertId int64 // RowsAffected returns the number of rows affected by an // update, insert, or delete. Not every database or database // driver may support this. RowsAffected int64 // 欄位名稱 Columns []string // 數據筆數 NRow int32 // 欄位個數 NColumn int32 Datas [][]string }
Click to show internal directories.
Click to hide internal directories.