store

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseColumn

type BaseColumn struct {
	CreatedAt time.Time  `gorm:"column:created_at"`
	UpdatedAt time.Time  `gorm:"column:updated_at"`
	DeletedAt *time.Time `gorm:"column:deleted_at"`
}

gorm.Model definition

type BaseInfo

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

func (*BaseInfo) Init

func (this *BaseInfo) Init(address string, port int64, account string, passwd string)

type CreateDBFactory

type CreateDBFactory struct {
	IsInternalStore bool
	DatabaseName    string
}

func (*CreateDBFactory) CreateDBConnect

func (db *CreateDBFactory) CreateDBConnect(db_type string) DBconnect

func (*CreateDBFactory) GetDatabaseName added in v0.0.12

func (db *CreateDBFactory) GetDatabaseName() string

func (*CreateDBFactory) GetDatabasePath added in v0.0.12

func (db *CreateDBFactory) GetDatabasePath(databaseName string) string

func (*CreateDBFactory) InitDB

func (db *CreateDBFactory) InitDB() DBconnect

func (*CreateDBFactory) SetDatabaseName added in v0.0.8

func (db *CreateDBFactory) SetDatabaseName(databaseName string)

func (*CreateDBFactory) SetIsInternalStore added in v0.0.7

func (db *CreateDBFactory) SetIsInternalStore(value bool)

type DBconnect

type DBconnect interface {
	Init(address string, port int64, account string, passwd string)
	Create(value interface{}) *gorm.DB
	Updates(value interface{}) *gorm.DB
	Update(column string, value interface{}) *gorm.DB
	Delete(value interface{}, conds ...interface{}) *gorm.DB
	Select(query interface{}, args ...interface{}) *gorm.DB
	Where(query interface{}, args ...interface{}) *gorm.DB
	First(out interface{}, where ...interface{}) *gorm.DB
	Find(out interface{}, where ...interface{}) *gorm.DB
	Connect()
	// HasTable(dst ...interface{}) bool
	// CreateTable(dst ...interface{}) error
	//AutoMigrate(dst ...interface{}) error
	Exec(sql string, values ...interface{}) *gorm.DB
	Raw(sql string, values ...interface{}) *gorm.DB
	Table(name string, args ...interface{}) *gorm.DB
	Migrator() gorm.Migrator
	InsertIgnore(value interface{}) error
}
type Link struct {
	BaseColumn
	LinkId     string `gorm:"column:link_id"`
	OldLinkId  string `gorm:"column:old_link_id"`
	LastNodeId string `gorm:"column:last_node_id"`
	NodeID     string `gorm:"column:node_id"`
}

Link model definition

type MysqlDB

type MysqlDB struct {
	BaseInfo
}

type Node

type Node struct {
	BaseColumn
	NodeId             string `gorm:"column:node_id"`
	NodeType           string `gorm:"column:node_type"`
	LamportClock       int64  `gorm:"column:lamport_clock"`
	ReceivingTimestamp int32  `gorm:"column:receiving_timestamp"`
	ReceivingDate      string `gorm:"column:receiving_date"`
	SendingDate        string `gorm:"column:sending_date"`
	SendingTimestamp   int32  `gorm:"column:sending_timestamp"`
	LastNodeId         string `gorm:"column:last_node_id"`
}

Node model definition

type Object

type Object struct {
	BaseColumn
	ObjectId  string `gorm:"column:object_id"`
	NodeId    string `gorm:"column:node_id"`
	Content   string `gorm:"column:content"`
	Operation string `gorm:"column:operation"`
	Property  string `gorm:"column:propertie"`
}

type Service

type Service struct {
	BaseColumn
	ServiceId string `gorm:"column:link_id"`
	Cid       string `gorm:"column:cid"`
	Ip        string `gorm:"column:ip"`
}

Link model definition

type SqliteDB

type SqliteDB struct {
	BaseInfo
	OrmDB *gorm.DB
}

func (*SqliteDB) Connect

func (db *SqliteDB) Connect()

func (*SqliteDB) Create

func (db *SqliteDB) Create(value interface{}) *gorm.DB

func (*SqliteDB) Delete

func (db *SqliteDB) Delete(value interface{}, conds ...interface{}) *gorm.DB

func (*SqliteDB) Exec added in v0.0.7

func (db *SqliteDB) Exec(sql string, values ...interface{}) *gorm.DB

func (*SqliteDB) Find

func (db *SqliteDB) Find(out interface{}, where ...interface{}) *gorm.DB

func (*SqliteDB) First

func (db *SqliteDB) First(out interface{}, where ...interface{}) *gorm.DB

func (*SqliteDB) InsertIgnore added in v0.0.5

func (db *SqliteDB) InsertIgnore(value interface{}) error

func (*SqliteDB) Migrator

func (db *SqliteDB) Migrator() gorm.Migrator

func (*SqliteDB) Raw added in v0.0.8

func (db *SqliteDB) Raw(sql string, values ...interface{}) *gorm.DB

func (*SqliteDB) Select

func (db *SqliteDB) Select(query interface{}, args ...interface{}) *gorm.DB

func (*SqliteDB) Table added in v0.0.8

func (db *SqliteDB) Table(name string, args ...interface{}) *gorm.DB

func (*SqliteDB) Update added in v0.0.6

func (db *SqliteDB) Update(column string, value interface{}) *gorm.DB

func (*SqliteDB) Updates

func (db *SqliteDB) Updates(value interface{}) *gorm.DB

func (*SqliteDB) Where

func (db *SqliteDB) Where(query interface{}, args ...interface{}) *gorm.DB

Jump to

Keyboard shortcuts

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