Documentation ¶
Index ¶
- Variables
- func DeleteState(metadata *types.RequestMetadata, storageClient types.StorageClient) error
- func GetState(metadata *types.RequestMetadata, storageClient types.StorageClient) ([]byte, error)
- func GetStorageClient(metadata *types.RequestMetadata) (types.StorageClient, error)
- func LockState(metadata *types.RequestMetadata, storageClient types.StorageClient, ...) error
- func ParseMetadata(request *http.Request) (*types.RequestMetadata, error)
- func UnLockState(metadata *types.RequestMetadata, storageClient types.StorageClient, ...) error
- func UpdateState(metadata *types.RequestMetadata, storageClient types.StorageClient, ...) error
Constants ¶
This section is empty.
Variables ¶
var KnownStorageTypes = make(map[string]types.StorageClient)
KnownStorageTypes map storage types to storage clients before starting the server so backend knows what's supported
Functions ¶
func DeleteState ¶
func DeleteState(metadata *types.RequestMetadata, storageClient types.StorageClient) error
DeleteState deleting state from the storage. This is a write operation, so it's checking if the state was previously locked by a requestor.
func GetState ¶
func GetState(metadata *types.RequestMetadata, storageClient types.StorageClient) ([]byte, error)
GetState attempt to read the state from storage. Clinet implementations must return NoErrStateDidNotExisted if the state did not existed.
func GetStorageClient ¶
func GetStorageClient(metadata *types.RequestMetadata) (types.StorageClient, error)
GetStorageClient initialize and return a StorageClient.
func LockState ¶
func LockState(metadata *types.RequestMetadata, storageClient types.StorageClient, body []byte) error
LockState will lock the state as requested. Locking must be atomic operation so leave all checks for the client. Client implementations must return ErrLockingConflict if it was already locked by someone else.
func ParseMetadata ¶
func ParseMetadata(request *http.Request) (*types.RequestMetadata, error)
ParseMetadata look into the request and read metadata
func UnLockState ¶
func UnLockState(metadata *types.RequestMetadata, storageClient types.StorageClient, body []byte) error
UnLockState will unlock the state as requested.
func UpdateState ¶
func UpdateState(metadata *types.RequestMetadata, storageClient types.StorageClient, body []byte) error
UpdateState create or update existing state. This is a write operation, so it's checking if the state was previously locked by a requestor.
Types ¶
This section is empty.