Documentation
¶
Index ¶
- Constants
- func CheckETagAfterDelete(ops []state.TransactionalStateOperation) error
- func JSONStringify(value any) ([]byte, error)
- func Marshal(val interface{}, marshaler func(interface{}) ([]byte, error)) ([]byte, error)
- func ParseTTL(requestMetadata map[string]string) (*int, error)
- func ParseTTL64(requestMetadata map[string]string) (*int64, error)
- type KeyOp
Constants ¶
const MetadataTTLKey = "ttlInSeconds"
Key used for "ttlInSeconds" in metadata.
Variables ¶
This section is empty.
Functions ¶
func CheckETagAfterDelete ¶ added in v1.19.2
func CheckETagAfterDelete(ops []state.TransactionalStateOperation) error
CheckETagAfterDelete returns an ETagMismatch for a set with an etag on a key that an earlier op in ops deleted. The stored version is gone by then, so the etag can't match, but a store that creates a missing key on an etag would write it.
func JSONStringify ¶ added in v1.12.0
Types ¶
type KeyOp ¶ added in v1.19.1
type KeyOp struct {
Op state.TransactionalStateOperation
Guard state.TransactionalStateOperation
}
KeyOp applies the last op on a key, guarded by the first op's etag or first-write option.
func CollapseOps ¶ added in v1.19.1
func CollapseOps(ops []state.TransactionalStateOperation) ([]KeyOp, error)
CollapseOps returns one KeyOp per key, ordered by each key's last op. A later op can't be checked against the stored value, so one with an etag, or a first-write set after a set, is an ETagMismatch.