mysqldao

package
v0.0.0-...-38045c3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlConifg

type MysqlConifg struct {
	Hostname    string
	Port        string
	User        string
	Password    string
	DbName      string
	TablePrefix string

	MaxOpenConnections int
	MaxIdleConnections int
	ConnMaxLifetime    int // unit second
	Debug              bool
}

MysqlConifg implements config

type RdsService

type RdsService struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

RdsService

func NewRdsService

func NewRdsService(config MysqlConifg) (*RdsService, error)

NewRdsService create new mysql dao service

func (*RdsService) Add

func (s *RdsService) Add(item interface{}) error

Add single item

func (*RdsService) Close

func (s *RdsService) Close() error

Close db

func (*RdsService) Del

func (s *RdsService) Del(item interface{}) error

Del single item

func (*RdsService) RegistTable

func (s *RdsService) RegistTable(t interface{})

RegistTable create table for given object

func (*RdsService) RegistTables

func (s *RdsService) RegistTables(tables []interface{})

RegistTables create tables for given object

func (*RdsService) Save

func (s *RdsService) Save(item interface{}) error

Save single item

Jump to

Keyboard shortcuts

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