Documentation ¶
Index ¶
- Constants
- func CheckRequestOptions(options interface{}) error
- func DeleteWithOptions(method func(req *DeleteRequest) error, req *DeleteRequest) error
- func Ping(store Store) error
- func SetWithOptions(method func(req *SetRequest) error, req *SetRequest) error
- type BulkDeleteRowMismatchError
- type BulkGetResponse
- type BulkStore
- type DefaultBulkStore
- type DeleteRequest
- type DeleteStateOption
- type ETagError
- type ETagErrorKind
- type Feature
- type GetRequest
- type GetResponse
- type GetStateOption
- type KeyInt
- type Metadata
- type OperationType
- type Querier
- type QueryItem
- type QueryRequest
- type QueryResponse
- type SetRequest
- type SetStateOption
- type Store
- type TransactionalStateOperation
- type TransactionalStateRequest
- type TransactionalStore
Constants ¶
const ( FirstWrite = "first-write" LastWrite = "last-write" Strong = "strong" Eventual = "eventual" )
Variables ¶
This section is empty.
Functions ¶
func CheckRequestOptions ¶ added in v0.3.0
func CheckRequestOptions(options interface{}) error
CheckRequestOptions checks if request options use supported keywords.
func DeleteWithOptions ¶ added in v0.3.0
func DeleteWithOptions(method func(req *DeleteRequest) error, req *DeleteRequest) error
DeleteWithOptions handles DeleteRequest with options.
func SetWithOptions ¶ added in v0.3.0
func SetWithOptions(method func(req *SetRequest) error, req *SetRequest) error
SetWithOptions handles SetRequest with request options.
Types ¶
type BulkDeleteRowMismatchError ¶ added in v1.7.0
type BulkDeleteRowMismatchError struct {
// contains filtered or unexported fields
}
BulkDeleteRowMismatchError represents mismatch in rowcount while deleting rows.
func NewBulkDeleteRowMismatchError ¶ added in v1.7.0
func NewBulkDeleteRowMismatchError(expected, affected uint64) *BulkDeleteRowMismatchError
BulkDeleteRowMismatchError returns a BulkDeleteRowMismatchError.
func (*BulkDeleteRowMismatchError) Error ¶ added in v1.7.0
func (e *BulkDeleteRowMismatchError) Error() string
type BulkGetResponse ¶ added in v1.0.0
type BulkGetResponse struct { Key string `json:"key"` Data []byte `json:"data"` ETag *string `json:"etag,omitempty"` Metadata map[string]string `json:"metadata"` Error string `json:"error,omitempty"` ContentType *string `json:"contentType,omitempty"` }
BulkGetResponse is the response object for bulk get response.
type BulkStore ¶ added in v1.0.0
type BulkStore interface { BulkDelete(req []DeleteRequest) error BulkGet(req []GetRequest) (bool, []BulkGetResponse, error) BulkSet(req []SetRequest) error }
BulkStore is an interface to perform bulk operations on store.
type DefaultBulkStore ¶ added in v1.0.0
type DefaultBulkStore struct {
// contains filtered or unexported fields
}
DefaultBulkStore is a default implementation of BulkStore.
func NewDefaultBulkStore ¶ added in v1.0.0
func NewDefaultBulkStore(store Store) DefaultBulkStore
NewDefaultBulkStore build a default bulk store.
func (*DefaultBulkStore) BulkDelete ¶ added in v1.0.0
func (b *DefaultBulkStore) BulkDelete(req []DeleteRequest) error
BulkDelete performs a bulk delete operation.
func (*DefaultBulkStore) BulkGet ¶ added in v1.0.0
func (b *DefaultBulkStore) BulkGet(req []GetRequest) (bool, []BulkGetResponse, error)
BulkGet performs a bulks get operations.
func (*DefaultBulkStore) BulkSet ¶ added in v1.0.0
func (b *DefaultBulkStore) BulkSet(req []SetRequest) error
BulkSet performs a bulks save operation.
func (*DefaultBulkStore) Features ¶ added in v1.1.1
func (b *DefaultBulkStore) Features() []Feature
Features returns the features of the encapsulated store.
type DeleteRequest ¶
type DeleteRequest struct { Key string `json:"key"` ETag *string `json:"etag,omitempty"` Metadata map[string]string `json:"metadata"` Options DeleteStateOption `json:"options,omitempty"` }
DeleteRequest is the object describing a delete state request.
func (DeleteRequest) GetKey ¶ added in v0.2.0
func (r DeleteRequest) GetKey() string
Key gets the Key on a DeleteRequest.
func (DeleteRequest) GetMetadata ¶ added in v0.2.0
func (r DeleteRequest) GetMetadata() map[string]string
Metadata gets the Metadata on a DeleteRequest.
type DeleteStateOption ¶
type DeleteStateOption struct { Concurrency string `json:"concurrency,omitempty"` // "concurrency" Consistency string `json:"consistency"` // "eventual, strong" }
DeleteStateOption controls how a state store reacts to a delete request.
type ETagError ¶ added in v1.0.0
type ETagError struct {
// contains filtered or unexported fields
}
ETagError is a custom error type for etag exceptions.
func NewETagError ¶ added in v1.0.0
func NewETagError(kind ETagErrorKind, err error) *ETagError
NewETagError returns an ETagError wrapping an existing context error.
func (*ETagError) Kind ¶ added in v1.0.0
func (e *ETagError) Kind() ETagErrorKind
type ETagErrorKind ¶ added in v1.0.0
type ETagErrorKind string
const ( ETagInvalid ETagErrorKind = "invalid" ETagMismatch ETagErrorKind = "mismatch" )
type Feature ¶ added in v1.1.1
type Feature string
Feature names a feature that can be implemented by PubSub components.
const ( // FeatureETag is the feature to etag metadata in state store. FeatureETag Feature = "ETAG" // FeatureTransactional is the feature that performs transactional operations. FeatureTransactional Feature = "TRANSACTIONAL" // FeatureQueryAPI is the feature that performs query operations. FeatureQueryAPI Feature = "QUERY_API" )
type GetRequest ¶
type GetRequest struct { Key string `json:"key"` Metadata map[string]string `json:"metadata"` Options GetStateOption `json:"options,omitempty"` }
GetRequest is the object describing a state fetch request.
type GetResponse ¶
type GetResponse struct { Data []byte `json:"data"` ETag *string `json:"etag,omitempty"` Metadata map[string]string `json:"metadata"` ContentType *string `json:"contentType,omitempty"` }
GetResponse is the response object for getting state.
type GetStateOption ¶
type GetStateOption struct {
Consistency string `json:"consistency"` // "eventual, strong"
}
GetStateOption controls how a state store reacts to a get request.
type KeyInt ¶ added in v0.2.0
KeyInt is an interface that allows gets of the Key and Metadata inside requests.
type OperationType ¶
type OperationType string
OperationType describes a CRUD operation performed against a state store.
const Delete OperationType = "delete"
Delete is a delete operation.
const Upsert OperationType = "upsert"
Upsert is an update or create operation.
type Querier ¶ added in v1.5.0
type Querier interface {
Query(req *QueryRequest) (*QueryResponse, error)
}
Querier is an interface to execute queries.
type QueryItem ¶ added in v1.5.0
type QueryItem struct { Key string `json:"key"` Data []byte `json:"data"` ETag *string `json:"etag,omitempty"` Error string `json:"error,omitempty"` ContentType *string `json:"contentType,omitempty"` }
QueryItem is an object representing a single entry in query results.
type QueryRequest ¶ added in v1.5.0
type QueryResponse ¶ added in v1.5.0
type QueryResponse struct { Results []QueryItem `json:"results"` Token string `json:"token,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` }
QueryResponse is the response object for querying state.
type SetRequest ¶
type SetRequest struct { Key string `json:"key"` Value interface{} `json:"value"` ETag *string `json:"etag,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` Options SetStateOption `json:"options,omitempty"` ContentType *string `json:"contentType,omitempty"` }
SetRequest is the object describing an upsert request.
func (SetRequest) GetKey ¶ added in v0.2.0
func (r SetRequest) GetKey() string
GetKey gets the Key on a SetRequest.
func (SetRequest) GetMetadata ¶ added in v0.2.0
func (r SetRequest) GetMetadata() map[string]string
GetMetadata gets the Key on a SetRequest.
type SetStateOption ¶
type SetStateOption struct { Concurrency string `json:"concurrency,omitempty"` // first-write, last-write Consistency string `json:"consistency"` // "eventual, strong" }
SetStateOption controls how a state store reacts to a set request.
type Store ¶
type Store interface { BulkStore Init(metadata Metadata) error Features() []Feature Delete(req *DeleteRequest) error Get(req *GetRequest) (*GetResponse, error) Set(req *SetRequest) error }
Store is an interface to perform operations on store.
type TransactionalStateOperation ¶ added in v0.3.0
type TransactionalStateOperation struct { Operation OperationType `json:"operation"` Request interface{} `json:"request"` }
TransactionalStateOperation describes operation type, key, and value for transactional operation.
type TransactionalStateRequest ¶ added in v0.3.0
type TransactionalStateRequest struct { Operations []TransactionalStateOperation `json:"operations"` Metadata map[string]string `json:"metadata,omitempty"` }
TransactionalStateRequest describes a transactional operation against a state store that comprises multiple types of operations The Request field is either a DeleteRequest or SetRequest.
type TransactionalStore ¶
type TransactionalStore interface { Init(metadata Metadata) error Multi(request *TransactionalStateRequest) error }
TransactionalStore is an interface for initialization and support multiple transactional requests.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
alicloud
|
|
aws
|
|
azure
|
|
gcp
|
|
hashicorp
|
|
oci
|
|
Package zookeeper is a generated GoMock package.
|
Package zookeeper is a generated GoMock package. |