go-api-boilerplate: github.com/vardius/go-api-boilerplate/pkg/mysql Index | Files

package mysql

import "github.com/vardius/go-api-boilerplate/pkg/mysql"

Index

Package Files

connection.go types.go

func NewConnection Uses

func NewConnection(ctx context.Context, cfg ConnectionConfig, logger *log.Logger) (db *sql.DB)

NewConnection provides new mysql connection

type ConnectionConfig Uses

type ConnectionConfig struct {
    Host            string
    Port            int
    User            string
    Pass            string
    Database        string
    ConnMaxLifetime time.Duration
    MaxIdleConns    int
    MaxOpenConns    int
}

ConnectionConfig provides values for gRPC connection configuration

type NullBool Uses

type NullBool struct{ sql.NullBool }

NullBool is an alias for sql.NullBool data type

func (NullBool) MarshalJSON Uses

func (nb NullBool) MarshalJSON() ([]byte, error)

MarshalJSON for NullBool

func (NullBool) UnmarshalJSON Uses

func (nb NullBool) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullBool

type NullFloat64 Uses

type NullFloat64 struct{ sql.NullFloat64 }

NullFloat64 is an alias for sql.NullFloat64 data type

func (NullFloat64) MarshalJSON Uses

func (nf NullFloat64) MarshalJSON() ([]byte, error)

MarshalJSON for NullFloat64

func (NullFloat64) UnmarshalJSON Uses

func (nf NullFloat64) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullFloat64

type NullInt64 Uses

type NullInt64 struct{ sql.NullInt64 }

NullInt64 is an alias for sql.NullInt64 data type

func (NullInt64) MarshalJSON Uses

func (ni NullInt64) MarshalJSON() ([]byte, error)

MarshalJSON for NullInt64

func (NullInt64) UnmarshalJSON Uses

func (ni NullInt64) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullInt64

type NullString Uses

type NullString struct{ sql.NullString }

NullString is an alias for sql.NullString data type

func (NullString) MarshalJSON Uses

func (ns NullString) MarshalJSON() ([]byte, error)

MarshalJSON for NullString

func (NullString) UnmarshalJSON Uses

func (ns NullString) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullString

type NullTime Uses

type NullTime struct{ mysql.NullTime }

NullTime is an alias for mysql.NullTime data type

func (NullTime) MarshalJSON Uses

func (nt NullTime) MarshalJSON() ([]byte, error)

MarshalJSON for NullTime

func (NullTime) UnmarshalJSON Uses

func (nt NullTime) UnmarshalJSON(b []byte) error

UnmarshalJSON for NullTime

Package mysql imports 8 packages (graph) and is imported by 4 packages. Updated 2020-08-04. Refresh now. Tools for package owners.