db

package
v0.0.0-...-9247a65 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonDatabase

type CommonDatabase interface {
	Connect() *r.Session
	CreateTable(tableName string) bool
	GetTableNames() ([]string, error)
	ContainTable(tableName string) bool
	Insert(tableName string, instance interface{}) (*entity.Object, error)
	Find(tableName string) []*entity.Object
	FindByID(tableName string, id string) (*entity.Object, error)
	Update(tableName string, id string, instance *entity.Object) (*entity.Object, error)
	Delete(objectName string, objectID string) (bool, error)
}

CommonDatabase .

type ObjectGatewayImpl

type ObjectGatewayImpl struct {
	Datatbase CommonDatabase
}

ObjectGatewayImpl .

func (ObjectGatewayImpl) Delete

func (gateway ObjectGatewayImpl) Delete(objectName string, objectID string) (bool, error)

Delete .

func (ObjectGatewayImpl) Find

func (gateway ObjectGatewayImpl) Find(objectName string) []*entity.Object

Find .

func (ObjectGatewayImpl) FindAll

func (gateway ObjectGatewayImpl) FindAll() ([]string, error)

FindAll .

func (ObjectGatewayImpl) FindByID

func (gateway ObjectGatewayImpl) FindByID(objectName string, objectID string) (*entity.Object, error)

FindByID .

func (ObjectGatewayImpl) Insert

func (gateway ObjectGatewayImpl) Insert(objectName string, instance interface{}) (*entity.Object, error)

Insert .

func (ObjectGatewayImpl) Update

func (gateway ObjectGatewayImpl) Update(objectName string, objectID string, instance *entity.Object) (*entity.Object, error)

Update .

type RethinkDB

type RethinkDB struct {
	Session *r.Session
}

RethinkDB .

func (RethinkDB) Connect

func (db RethinkDB) Connect() *r.Session

Connect .

func (RethinkDB) ContainTable

func (db RethinkDB) ContainTable(tableName string) bool

ContainTable .

func (RethinkDB) CreateTable

func (db RethinkDB) CreateTable(tableName string) bool

CreateTable .

func (RethinkDB) Delete

func (db RethinkDB) Delete(tableName string, id string) (bool, error)

Delete .

func (RethinkDB) Find

func (db RethinkDB) Find(tableName string) []*entity.Object

Find .

func (RethinkDB) FindByID

func (db RethinkDB) FindByID(tableName string, id string) (*entity.Object, error)

FindByID .

func (RethinkDB) GetTableNames

func (db RethinkDB) GetTableNames() ([]string, error)

GetTableNames .

func (RethinkDB) Insert

func (db RethinkDB) Insert(tableName string, instance interface{}) (*entity.Object, error)

Insert .

func (RethinkDB) Update

func (db RethinkDB) Update(tableName string, id string, instance *entity.Object) (*entity.Object, error)

Update .

Jump to

Keyboard shortcuts

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