client

package
v1.0.0-alpha4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CompareEqual               = "equal"
	CompareLike                = "like"
	CompareNot                 = "not"
	CompareIn                  = "in"
	CompareNotIn               = "notin"
	CompareLessThan            = "lt"
	CompareGreaterThan         = "gt"
	CompareLessThanAndEqual    = "lte"
	CompareGreaterThanAndEqual = "gte"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoMigrateBatchRequest

type AutoMigrateBatchRequest struct {
	Items []AutoMigrateItem
}

type AutoMigrateItem

type AutoMigrateItem struct {
	TablePrefixWithSchema string
	Version               string
	TableModelDescribe    TableModelDescribe
}

type AutoMigrateRequest

type AutoMigrateRequest struct {
	AutoMigrateItem
}

type Client

type Client interface {
	AutoMigrate(request *AutoMigrateRequest) error
	AutoMigrateBatch(request *AutoMigrateBatchRequest) 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 ColumnCompare

type ColumnCompare struct {
	Column  string `json:"column"`
	Value   any    `json:"value"`
	Compare string `json:"compare"`
}

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                 []ColumnCompare
	Or                    []ColumnCompare
	GroupBy               []string
	Join                  string
	Having                []ColumnCompare
}

type CommonEventQueryRequest

type CommonEventQueryRequest struct {
	TablePrefixWithSchema string
	Select                string
	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                string
	Where                 []ColumnCompare
	OrderBy               []string
	Or                    []ColumnCompare
	GroupBy               []string
	Join                  string
	Having                []ColumnCompare
	PageNo                int
	PageSize              int
}

type CountEventByKeysRequest

type CountEventByKeysRequest struct {
	TablePrefixWithSchema string
	KeyValues             []string
}

type CountWhereRequest

type CountWhereRequest struct {
	TablePrefixWithSchema string
	Version               string
	Where                 []ColumnCompare
}

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                string
	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                string
	KeyValues             map[string]string
}

type QueryByWhereAndOrderByRequest

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

type ReplayRequest

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

type TableModelDescribe

type TableModelDescribe struct {
	Fields []TableModelField `json:"fields"`
}

type TableModelField

type TableModelField struct {
	Name string `json:"name"`
	Tag  string `json:"tag"`
}

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