client

package
v1.0.0-alpha9 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrorDBRecordHasExist

func IsErrorDBRecordHasExist(err error) bool

func IsErrorDBRecordNotExist

func IsErrorDBRecordNotExist(err error) bool

Types

type AutoMigrateItem

type AutoMigrateItem struct {
	TablePrefixWithSchema string
	Version               string
	TableModelDescribe    map[string]string
}

type AutoMigrateRequest

type AutoMigrateRequest struct {
	Items []AutoMigrateItem
}

type Client

type Client interface {
	AutoMigrate(request *AutoMigrateRequest) error
	Transaction(txFunc TransactionFunc) error
	Insert(request *InsertRequest) (string, error)
	InsertBatch(request *InsertBatchRequest) (string, error)
	Delete(request *DeleteRequest) (string, error)
	DeleteBatch(request *DeleteBatchRequest) (string, error)
	Update(request *UpdateRequest) (string, error)
	Replay(request *ReplayRequest) (string, error)
	QueryByWhereAndOrderBy(request *QueryByWhereAndOrderByRequest) (string, []map[string]any, int64, error)
	CommonQuery(request *CommonQueryRequest) (string, []map[string]any, int64, error)
	QueryByKeys(request *QueryByKeysRequest) (string, map[string]any, error)
	CountWhere(request *CountWhereRequest) (string, int64, error)
	CommonCount(request *CommonCountRequest) (string, int64, error)
	EventQueryByKeys(request *EventQueryByKeysRequest) (string, []EventInfo, int64, error)
	CommonEventQuery(request *CommonEventQueryRequest) (string, []EventInfo, int64, error)
	CountEventByKeys(request *CountEventByKeysRequest) (string, int64, error)
	CommonCountEvent(request *CommonCountEventRequest) (string, int64, error)
	EventHistoryQueryByKeys(request *EventQueryByKeysRequest) (string, []EventInfo, int64, error)
	CommonEventHistoryQuery(request *CommonEventQueryRequest) (string, []EventInfo, int64, error)
	CountEventHistoryByKeys(request *CountEventByKeysRequest) (string, int64, error)
	CommonCountEventHistory(request *CommonCountEventRequest) (string, int64, error)
}

type CommonCountEventRequest

type CommonCountEventRequest struct {
	TablePrefixWithSchema string
	KeyValues             []string
	Version               string
	Operation             string
	CreatorID             string
	StartCreatedTime      string
	EndCreatedTime        string
}

type CommonCountRequest

type CommonCountRequest struct {
	TablePrefixWithSchema string
	Version               string
	Where                 map[string][]any
	Or                    map[string][]any
	GroupBy               []string
	Joins                 map[string][]any
	Having                map[string][]any
}

type CommonEventQueryRequest

type CommonEventQueryRequest struct {
	TablePrefixWithSchema string
	Select                map[string][]any
	KeyValues             []string
	Version               string
	Operation             string
	CreatorID             string
	StartCreatedTime      string
	EndCreatedTime        string
	PageNo                int
	PageSize              int
}

type CommonQueryRequest

type CommonQueryRequest struct {
	TablePrefixWithSchema string
	Version               string
	Select                map[string][]any
	Where                 map[string][]any
	OrderBy               []string
	Or                    map[string][]any
	GroupBy               []string
	Joins                 map[string][]any
	Having                map[string][]any
	PageNo                int
	PageSize              int
}

type CountEventByKeysRequest

type CountEventByKeysRequest struct {
	TablePrefixWithSchema string
	KeyValues             []string
}

type CountWhereRequest

type CountWhereRequest struct {
	TablePrefixWithSchema string
	Version               string
	Where                 map[string][]any
}

type DeleteBatchRequest

type DeleteBatchRequest struct {
	Items  []DeleteTableRowItem
	UserID string
}

type DeleteItem

type DeleteItem struct {
	KeyValues map[string]string
}

type DeleteRequest

type DeleteRequest struct {
	TablePrefixWithSchema string
	Version               string
	KeyValues             map[string]string
	UserID                string
}

type DeleteTableRowItem

type DeleteTableRowItem struct {
	TablePrefixWithSchema string
	Version               string
	Items                 []DeleteItem
}

type EventInfo

type EventInfo struct {
	Key        string
	Version    string
	Operation  string
	Value      string
	CreatorID  string
	CreateTime time.Time
}

func FormEventInfo

func FormEventInfo(info *response.EventInfo) *EventInfo

func FormEventInfoBatch

func FormEventInfoBatch(infos []*response.EventInfo) []EventInfo

type EventQueryByKeysRequest

type EventQueryByKeysRequest struct {
	TablePrefixWithSchema string
	Select                map[string][]any
	KeyValues             []string
	PageNo                int
	PageSize              int
}

type InsertBatchRequest

type InsertBatchRequest struct {
	Items  []InsertTableRowItem
	UserID string
}

type InsertItem

type InsertItem struct {
	KeyColumns []string
	TableRow   map[string]any
}

type InsertRequest

type InsertRequest struct {
	TablePrefixWithSchema string
	Version               string
	KeyColumns            []string
	TableRow              map[string]any
	UserID                string
}

type InsertTableRowItem

type InsertTableRowItem struct {
	TablePrefixWithSchema string
	Version               string
	Items                 []InsertItem
}

type QueryByKeysRequest

type QueryByKeysRequest struct {
	TablePrefixWithSchema string
	Version               string
	Select                map[string][]any
	KeyValues             map[string]string
}

type QueryByWhereAndOrderByRequest

type QueryByWhereAndOrderByRequest struct {
	TablePrefixWithSchema string
	Version               string
	Select                map[string][]any
	Where                 map[string][]any
	OrderBy               []string
	PageNo                int
	PageSize              int
}

type ReplayRequest

type ReplayRequest struct {
	TablePrefixWithSchema string
	Version               string
	KeyValues             map[string]string
	UserID                string
}

type Transaction

type Transaction interface {
	InsertTx(request *InsertRequest) (string, error)
	InsertBatchTx(request *InsertBatchRequest) (string, error)
	DeleteTx(request *DeleteRequest) (string, error)
	DeleteBatchTx(request *DeleteBatchRequest) (string, error)
	UpdateTx(request *UpdateRequest) (string, error)
	End() error
}

type TransactionFunc

type TransactionFunc func(tx Transaction) error

type UpdateRequest

type UpdateRequest struct {
	TablePrefixWithSchema string
	Version               string
	KeyValues             map[string]string
	NewTableRow           map[string]any
	UserID                string
}

Jump to

Keyboard shortcuts

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