api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	IdAdd = "Add"
)
View Source
const (
	IdBatch = "Batch"
)
View Source
const (
	IdDelete = "Delete"
)
View Source
const (
	IdDummy = "Dummy"
)
View Source
const (
	IdGet = "Get"
)
View Source
const (
	IdUpdate = "Update"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddReply

type AddReply struct {
	ws.ReplyStatus
}

type AddRequest

type AddRequest struct {
	ws.Request
	CollectionInfo

	Key    string
	Value1 string
	Value2 string
}

func (*AddRequest) Reply

func (request *AddRequest) Reply(env *ws.Environment) (ws.Reply, error)

type Batch

type Batch struct {
	Collection     CollectionInfo
	AddRequests    []*AddRequest
	GetRequests    []*GetRequest
	DeleteRequests []*DeleteRequest
	UpdateRequests []*UpdateRequest
}

func (*Batch) Add

func (batch *Batch) Add(key, value1, value2 string)

func (*Batch) Delete

func (batch *Batch) Delete(key, value1, value2 string)

func (*Batch) Get

func (batch *Batch) Get(key string)

func (*Batch) Update

func (batch *Batch) Update(update Update)

type BatchReply

type BatchReply struct {
	ws.ReplyStatus

	AddReplys    []AddReply
	GetReplys    []GetReply
	DeleteReplys []DeleteReply
	UpdateReplys []UpdateReply
}

type BatchRequest

type BatchRequest struct {
	ws.Request
	Batch *Batch
}

func NewBatchRequest

func NewBatchRequest(batch *Batch) *BatchRequest

func (*BatchRequest) Reply

func (request *BatchRequest) Reply(env *ws.Environment) (ws.Reply, error)

type CollectionInfo

type CollectionInfo struct {
	Namespace    string
	CollectionId string
}

func (CollectionInfo) NewAddRequest

func (c CollectionInfo) NewAddRequest(key, value1, value2 string) *AddRequest

func (CollectionInfo) NewDeleteRequest

func (c CollectionInfo) NewDeleteRequest(key, value1, value2 string) *DeleteRequest

func (CollectionInfo) NewDummyRequest

func (c CollectionInfo) NewDummyRequest() *DummyRequest

func (CollectionInfo) NewGetRequest

func (c CollectionInfo) NewGetRequest(key string) *GetRequest

func (CollectionInfo) NewUpdateRequest

func (c CollectionInfo) NewUpdateRequest(update Update) *UpdateRequest

type DeleteReply

type DeleteReply struct {
	ws.ReplyStatus
}

type DeleteRequest

type DeleteRequest struct {
	ws.Request
	CollectionInfo

	Key    string
	Value1 string
	Value2 string
}

func (*DeleteRequest) Reply

func (request *DeleteRequest) Reply(env *ws.Environment) (ws.Reply, error)

type DummyReply

type DummyReply struct {
	ws.ReplyStatus
	Hello string
}

type DummyRequest

type DummyRequest struct {
	ws.Request
	CollectionInfo

	SomeData string
}

func (*DummyRequest) Reply

func (request *DummyRequest) Reply(env *ws.Environment) (ws.Reply, error)

type GetReply

type GetReply struct {
	ws.ReplyStatus
	Result tiedb.TripleSet
}

type GetRequest

type GetRequest struct {
	ws.Request
	CollectionInfo

	Key             string
	NextLevelValues []string
	Filter          string
}

func (*GetRequest) Reply

func (request *GetRequest) Reply(env *ws.Environment) (ws.Reply, error)

type Update

type Update struct {
	Key          string
	Value1       string
	Value2       string
	NewValue2    string
	AddOnFailure bool
}

type UpdateReply

type UpdateReply struct {
	ws.ReplyStatus
}

type UpdateRequest

type UpdateRequest struct {
	ws.Request
	CollectionInfo
	Update
}

func (*UpdateRequest) Reply

func (request *UpdateRequest) Reply(env *ws.Environment) (ws.Reply, error)

Jump to

Keyboard shortcuts

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