api

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type AddReply

type AddReply struct {
	ws.ReplyStatus
	OrigValue1 string
	OrigValue2 string
}

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 AssociatedOptions added in v0.3.2

type AssociatedOptions struct {
	MatchValue1 string
}

type AssociatedReply added in v0.1.8

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

type AssociatedRequest added in v0.1.8

type AssociatedRequest struct {
	ws.Request
	CollectionInfo

	Key string
	AssociatedOptions
}

func (*AssociatedRequest) Reply added in v0.1.8

func (request *AssociatedRequest) 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) NewAssociatedRequest added in v0.1.8

func (c CollectionInfo) NewAssociatedRequest(key string) *AssociatedRequest

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) NewSyncRequest added in v0.3.0

func (c CollectionInfo) NewSyncRequest() *SyncRequest

func (CollectionInfo) NewUpdateRequest

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

type DeleteReply

type DeleteReply struct {
	ws.ReplyStatus
	OrigValue1 string
	OrigValue2 string
}

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 GetOptions added in v0.3.2

type GetOptions struct {
	Intersect       []Transform
	Exclude         []Transform
	Filter          string
	Reverse         bool
	SortOnNextLevel bool
	GetNextLevel    bool
	NextLevelFilter string
	Sort            tiedb.SortOptions
}

type GetReply

type GetReply struct {
	ws.ReplyStatus
	Result          tiedb.TripleSet
	NextLevelResult tiedb.TripleSet
	TotalCount      int
}

func (GetReply) OneKey added in v0.1.2

func (gr GetReply) OneKey() (tiedb.Value1, bool)

Returns (Value1, true) from Result, if the only key in the Result is the requested key. In any other case it returns (nil, false)

func (GetReply) OneValue2 added in v0.1.4

func (gr GetReply) OneValue2(value1 string) (string, bool)

Returns (value of Value2, true) from Result, if the only key in the Result is the requested key, and if only 1 Value2 exists. In any other case it returns (empty string, false)

type GetRequest

type GetRequest struct {
	ws.Request
	CollectionInfo

	Key     string
	Options GetOptions
}

func (*GetRequest) Reply

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

type SyncReply added in v0.3.0

type SyncReply struct {
	ws.ReplyStatus
}

type SyncRequest added in v0.3.0

type SyncRequest struct {
	ws.Request
	CollectionInfo
}

func (*SyncRequest) Reply added in v0.3.0

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

type Transform added in v0.3.2

type Transform struct {
	Key     string
	Reverse bool
}

type Update

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

type UpdateReply

type UpdateReply struct {
	ws.ReplyStatus
	OrigValue1    string
	OrigValue2    string
	OrigNewValue2 string
}

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