database

package
v1.15.16 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATABASE_MYSQL = "zero.database.mysql"
)
View Source
const (
	DATABASE_ORACLE = "zero.database.oracle"
)
View Source
const (
	DATABASE_POSTGRES = "zero.database.postgres"
)
View Source
const (
	DATABASE_REDIS = "zero.database.redis"
)

Variables

This section is empty.

Functions

func InitCustomMysqlDatabase added in v1.14.14

func InitCustomMysqlDatabase(registerName, prefix string)

func InitCustomOracleDatabase added in v1.14.2

func InitCustomOracleDatabase(registerName, hostname string, hostport int, servOsid, dbname, password string)

func InitCustomPostgresDatabase added in v1.14.14

func InitCustomPostgresDatabase(registerName, prefix string)

func InitElasticDatabase

func InitElasticDatabase()

func InitMYSQLDatabase

func InitMYSQLDatabase()

func InitOracleDatabase added in v1.14.0

func InitOracleDatabase()

func InitPostgresDatabase

func InitPostgresDatabase()

func InitRedisDatabase

func InitRedisDatabase(observers ...RedisKeyspaceExpiredObserver)

Types

type DataSource added in v1.2.0

type DataSource interface {
	Connect() *sql.DB
	Transaction() *sql.Tx
}

type EQueryRequest

type EQueryRequest struct {
	Query interface{} `json:"query,omitempty"`
	// contains filtered or unexported fields
}

func (*EQueryRequest) Append

func (query *EQueryRequest) Append() error

func (*EQueryRequest) Delete

func (query *EQueryRequest) Delete() error

func (*EQueryRequest) DeleteByQuery

func (query *EQueryRequest) DeleteByQuery() error

func (*EQueryRequest) Get

func (query *EQueryRequest) Get() (*EQueryResponse, error)

func (*EQueryRequest) Init

func (query *EQueryRequest) Init(indexName string, documentID string, deleteQuery bool)

func (*EQueryRequest) InitIndex

func (query *EQueryRequest) InitIndex(indexName string)

func (*EQueryRequest) Search

func (query *EQueryRequest) Search() (*EQueryResponse, error)

func (*EQueryRequest) Update

func (query *EQueryRequest) Update() error

type EQueryResponse

type EQueryResponse struct {
	Datas []interface{}
	Total int
	Error string
}

func (*EQueryResponse) ParserData

func (qresp *EQueryResponse) ParserData(resp *http.Response) error

func (*EQueryResponse) ParserError

func (qresp *EQueryResponse) ParserError(resp *http.Response) error

type EQuerySearch

type EQuerySearch struct {
	Source         []string      `json:"_source,omitempty"`
	Size           int           `json:"size,omitempty"`
	From           int           `json:"from,omitempty"`
	Sort           []interface{} `json:"sort,omitempty"`
	Query          interface{}   `json:"query,omitempty"`
	TrackTotalHits int           `json:"track_total_hits,omitempty"`
}

type GormDataSource added in v1.14.0

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

func (*GormDataSource) Connect added in v1.14.0

func (cp *GormDataSource) Connect() *sql.DB

func (*GormDataSource) Transaction added in v1.14.0

func (cp *GormDataSource) Transaction() *sql.Tx

type RedisKeeper added in v1.12.0

type RedisKeeper interface {
	Client() *redis.Client
	Del(...string) error
	Set(string, string) error
	SetEx(string, string, int) error
	Get(string) (string, error)
}

type RedisKeyspaceExpiredObserver added in v1.12.1

type RedisKeyspaceExpiredObserver interface {
	OnMessage(*redis.Message) error
}

Jump to

Keyboard shortcuts

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