Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoEnv error = errors.New("no env variable provided -- ensure that the environment variables for MYSQL_USER and MYSQL_PASSWORD are set") ErrMissingUser error = errors.New("unset MySQL user variable: please export the MYSQL_USER variable") ErrMissingPassword error = errors.New("unset MySQL password variable: please export the MYSQL_PASSWORD variable") ErrMissingDatabase error = errors.New("unset MySQL database variable: please export the MYSQL_DATABASE variable") )
Functions ¶
func New ¶
func New(address, database string) (sqldb io.WriteCloser, err error)
New function will take in a mysql DB address and database name; and create a new instance of a MySQL object; returning an io.WriteCloser and an error.
func WithMySQL ¶
func WithMySQL(addr, database string) log.LoggerConfig
WithMySQL function takes in an address to a MySQL server, and a database name; and returns a LoggerConfig so that this type of writer is defined in a Logger
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
func (*MySQL) Close ¶
Close method is implemented for compatibility with the Database interface.
While this ORM doesn't force users to close the connection, MongoDB does, and the method should be available for use
Click to show internal directories.
Click to hide internal directories.