db

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mapper added in v1.1.0

func Mapper(i *tracer.Infos, data interface{}, to interface{}) error

Types

type Config

type Config interface {
	GetUser() string
	GetPassword() string
	GetHost() string
	GetPort() string
	GetDatabase() string
}

type Database

type Database interface {
	Connect(Config)
	Insert(*tracer.Infos, string, ...interface{}) (sql.Result, error)
	Update(*tracer.Infos, string, ...interface{}) (sql.Result, error)
	Get(*tracer.Infos, string, ...interface{}) (map[string]interface{}, error)
	Fetch(*tracer.Infos, string, ...interface{}) ([]map[string]interface{}, error)
}

type MySQL

type MySQL struct {
	// contains filtered or unexported fields
}

func (*MySQL) Connect

func (m *MySQL) Connect(c Config)

func (*MySQL) Fetch

func (m *MySQL) Fetch(i *tracer.Infos, query string, args ...interface{}) ([]map[string]interface{}, error)

func (*MySQL) Get

func (m *MySQL) Get(i *tracer.Infos, query string, args ...interface{}) (map[string]interface{}, error)

func (*MySQL) Insert

func (m *MySQL) Insert(i *tracer.Infos, query string, args ...interface{}) (sql.Result, error)

func (*MySQL) Update

func (m *MySQL) Update(i *tracer.Infos, query string, args ...interface{}) (sql.Result, error)

Jump to

Keyboard shortcuts

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