client

package
v1.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCreatedTime added in v1.2.0

func FormatCreatedTime(dataMap map[string]any, format string) string

func FormatLastEventTime added in v1.2.0

func FormatLastEventTime(dataMap map[string]any, format string) string

func GetCreateUserID added in v1.2.0

func GetCreateUserID(dataMap map[string]any) string

func GetLastUpdateUserID added in v1.2.0

func GetLastUpdateUserID(dataMap map[string]any) string

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)
	QueryOnlyByWhereAndOrderBy(request *QueryByWhereAndOrderByRequest) (string, []map[string]any, error)
	CommonQueryOnly(request *CommonQueryRequest) (string, []map[string]any, 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)
	EventQueryOnlyByKeys(request *EventQueryByKeysRequest) (string, []EventInfo, error)
	CommonEventQueryOnly(request *CommonEventQueryRequest) (string, []EventInfo, 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)
	EventHistoryQueryOnlyByKeys(request *EventQueryByKeysRequest) (string, []EventInfo, error)
	CommonEventHistoryQueryOnly(request *CommonEventQueryRequest) (string, []EventInfo, 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 DeleteRequest

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

type DeleteTableRowItem

type DeleteTableRowItem struct {
	TablePrefixWithSchema string
	Version               string
	KeyValues             []map[string]string
}

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 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
	KeyColumns            []string
	TableRows             []map[string]any
}

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)
}

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