db

package
v0.0.0-...-59e6379 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormHandler

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

func (*GormHandler) Create

func (g *GormHandler) Create(i interface{}) error

func (*GormHandler) Do

func (g *GormHandler) Do(f func(*gorm.DB) (interface{}, error)) (interface{}, error)

func (*GormHandler) Get

func (g *GormHandler) Get(i interface{}, q ...Query) error

func (*GormHandler) Gets

func (g *GormHandler) Gets(i interface{}, q ...Query) (int, error)

func (*GormHandler) Migrate

func (g *GormHandler) Migrate(i interface{}) error

func (*GormHandler) Ping

func (g *GormHandler) Ping() error

func (*GormHandler) SetContext

func (g *GormHandler) SetContext(key string, val interface{})

func (*GormHandler) Update

func (g *GormHandler) Update(i interface{}) error

type MongoHandler

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

func (*MongoHandler) Create

func (m *MongoHandler) Create(i interface{}) error

func (*MongoHandler) Get

func (m *MongoHandler) Get(i interface{}, q ...Query) error

func (*MongoHandler) Gets

func (m *MongoHandler) Gets(i interface{}, q ...Query) (int, error)

todo: set value

func (*MongoHandler) Ping

func (m *MongoHandler) Ping() error

func (*MongoHandler) SetContext

func (m *MongoHandler) SetContext(string, interface{})

func (*MongoHandler) Update

func (m *MongoHandler) Update(i interface{}) error

type ORMHandler

type ORMHandler interface {
	SetContext(string, interface{})
	Ping() error
	Create(interface{}) error
	Get(interface{}, ...Query) error
	Gets(interface{}, ...Query) (int, error)
	Update(interface{}) error
}

func DBFactory

func DBFactory(db string) ORMHandler

type Query

type Query struct {
	Key   string
	Op    string
	Value interface{}
}

Jump to

Keyboard shortcuts

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