Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultDatabaseHost string = "localhost" DefaultDatabasePort string = "3306" DefaultDatabaseName string = "go_queue_sql" DefaultDatabaseTable string = "queue" DefaultDriverName string = "mysql" DefaultUsername string = "root" DefaultPassword string = "mysql" DefaultParseTime bool = true )
default configuration items
View Source
const (
ErrUnsupportedTypef string = "unsupported type: %T\n"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct { Hostname string `json:"hostname"` Port string `json:"port"` Username string `json:"username"` Password string `json:"password"` Database string `json:"database"` Table string `json:"table"` ParseTime bool `json:"parse_time"` DriverName string `json:"driver_name"` }
Configuration provides the different items we can use to configure how we connect to the database
func (*Configuration) Default ¶
func (c *Configuration) Default()
func (*Configuration) FromEnvs ¶
func (c *Configuration) FromEnvs(envs map[string]string)
func (*Configuration) Validate ¶
func (c *Configuration) Validate() error
type ErrorHandlerFx ¶
type ErrorHandlerFx func(error)
type Owner ¶
type Owner interface { SetErrorHandler(ErrorHandlerFx) Configure(config *Configuration) error Initialize() error Shutdown() }
Click to show internal directories.
Click to hide internal directories.