state

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionUpsert = "upsert"
	TransactionDelete = "delete"
)

Variables

This section is empty.

Functions

func DestroyAPI

func DestroyAPI(api *API)

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(port int, timeout time.Duration) *API

func (*API) DeleteState

func (api *API) DeleteState(storeName string, key string, queryParams map[string]string) error

func (*API) GetState

func (api *API) GetState(storeName string, key string, queryParams map[string]string) (string, string, error)

func (*API) GetStateBulk

func (api *API) GetStateBulk(storeName string, queryParams map[string]string, request GetStateBulkRequest) ([]GetStateBulkItem, error)

func (*API) SaveState

func (api *API) SaveState(storeName string, request []SaveStateRequest) error

func (*API) Transaction

func (api *API) Transaction(storeName string, request TransactionRequest) error

type GetStateBulkItem

type GetStateBulkItem struct {
	Key  string `json:"key"`
	Data string `json:"data"`
	Etag string `json:"etag"`
}

type GetStateBulkRequest

type GetStateBulkRequest struct {
	Keys        []string `json:"keys"`
	Parallelism int      `json:"parallelism,omitempty"`
}

type SaveStateRequest

type SaveStateRequest struct {
	Key      string            `json:"key"`
	Value    string            `json:"value"`
	Etag     string            `json:"etag,omitempty"`
	MetaData map[string]string `json:"metadata,omitempty"`
	Options  map[string]string `json:"options,omitempty"`
}

type TransactionOperation

type TransactionOperation struct {
	Operation string                      `json:"operation"`
	Request   TransactionOperationRequest `json:"request"`
}

type TransactionOperationRequest

type TransactionOperationRequest struct {
	Key      string            `json:"key"`
	Value    string            `json:"value,omitempty"`
	Etag     string            `json:"etag,omitempty"`
	MetaData map[string]string `json:"metadata,omitempty"`
	Options  map[string]string `json:"options,omitempty"`
}

type TransactionRequest

type TransactionRequest struct {
	Operations []TransactionOperation `json:"operations"`
	MetaData   map[string]string      `json:"metadata,omitempty"`
}

Jump to

Keyboard shortcuts

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