my57

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Datetime MySQL 5.7 format.
	Datetime = "2006-01-02T15:04:05Z"
	// UpdateID is a user id to use with the updatedby column.
	UpdateID = "b66dc282-a029-4e99-85db-2cf2892fffcc"
)

Variables

View Source
var ErrConnect = errors.New("could not connect to the mysql database server")

Functions

func Connect

func Connect() *sql.DB

Connect will connect to the database and handle any errors.

Types

type Connection

type Connection struct {
	Name     string // Name of the database
	User     string // User name access.
	Pass     string // Pass is the user password.
	Server   string // Server is URI to connect to the database, using the protocol, address and port.
	Protocol string // Protocol to connect to the database.
	Address  string // Address to connect to the database.
	Port     string // Port to connect to the database.
}

Connection information for a MySQL database.

func Init

func Init() Connection

Init initialises the database connection using stored settings.

func (*Connection) String

func (c *Connection) String() string

Jump to

Keyboard shortcuts

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