跳到主要内容

Attribute

查看 Markdown

This page lists the Go SDK names for Attributes. The doc comment of each API gives its parameters, defaults, and errors. Read them in the Go SDK API reference.

API names​

TaskGo APIDex behavior
Define a singleton AttributeDefineAttribute, which returns an AttributeAttributes
Define an AttributeMapDefineAttributeMap, which returns an AttributeMapAttributes
Declare it in the FlowAttributes of PersistenceSchema, returned from GetPersistenceSchemaFlow definition
Read, write, and delete a value in a Step or RPCGet, Set, and DeleteCommits
Address one AttributeMap instanceThe instance argument of AttributeMap.Get, AttributeMap.Set, and AttributeMap.DeleteAttributes
Count AttributeMap instances and list their keysAttributeMap.MapSize and AttributeMap.AllInstanceKeysSelective state loading
Load AttributeMap values for a methodAttributeMap.Load, with the load fields of StepOptions or RPCOptionsSelective state loading
Lock a value for a read-modify-writeLockAttribute and LockAttributeMap, with the lock fields of StepOptions or LockAttributes of RPCOptionsLocks
Index a value for searchIndexed, with AttributeIndex and IndexTypeIndexes
Project writes to an Attribute StoreSyncToAttributeStoreAttribute sync
Store a value that can be erasedHardDeleteOnNullHard-delete Attributes
Set a value when the Flow startsInitialAttribute and InitialAttributeMapValue in StartFlowOptions.AttributesAttributes at start
Read values from outside the FlowClient.GetAttributes, with ReadAttribute and ReadAttributeMapInstanceRead Attributes
Wait until a value matchesClient.WaitForAttributeMatch and Client.WaitForAttributeMapInstanceMatch, with an AttributeMatch such as AttributeMatchEqualWait for an Attribute match

Example​

Example: examples/go/primitives/attribute/workflow.go