Documentation ¶
Index ¶
- func NewCosmosDBStateStore(logger logger.Logger) state.Store
- type CosmosItem
- type CosmosOperation
- type InternalQuery
- type Query
- func (q *Query) Finalize(filters string, qq *query.Query) error
- func (q *Query) VisitAND(f *query.AND) (string, error)
- func (q *Query) VisitEQ(f *query.EQ) (string, error)
- func (q *Query) VisitGT(f *query.GT) (string, error)
- func (q *Query) VisitGTE(f *query.GTE) (string, error)
- func (q *Query) VisitIN(f *query.IN) (string, error)
- func (q *Query) VisitLT(f *query.LT) (string, error)
- func (q *Query) VisitLTE(f *query.LTE) (string, error)
- func (q *Query) VisitNEQ(f *query.NEQ) (string, error)
- func (q *Query) VisitOR(f *query.OR) (string, error)
- type StateStore
- func (c *StateStore) BulkGet(ctx context.Context, req []state.GetRequest, _ state.BulkGetOpts) ([]state.BulkGetResponse, error)
- func (c *StateStore) Close() error
- func (c *StateStore) Delete(ctx context.Context, req *state.DeleteRequest) error
- func (c *StateStore) Features() []state.Feature
- func (c *StateStore) Get(ctx context.Context, req *state.GetRequest) (*state.GetResponse, error)
- func (c *StateStore) GetComponentMetadata() (metadataInfo contribmeta.MetadataMap)
- func (c *StateStore) Init(ctx context.Context, meta state.Metadata) error
- func (c *StateStore) Multi(ctx context.Context, request *state.TransactionalStateRequest) (err error)
- func (c StateStore) MultiMaxSize() int
- func (c *StateStore) Ping(ctx context.Context) error
- func (c *StateStore) Query(ctx context.Context, req *state.QueryRequest) (*state.QueryResponse, error)
- func (c *StateStore) Set(ctx context.Context, req *state.SetRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CosmosItem ¶
type CosmosItem struct { ID string `json:"id"` Value interface{} `json:"value"` IsBinary bool `json:"isBinary"` PartitionKey string `json:"partitionKey"` TTL *int `json:"ttl,omitempty"` Etag string `json:"_etag"` TS int64 `json:"_ts"` }
CosmosItem is a wrapper around a CosmosDB document.
func NewCosmosItemFromResponse ¶ added in v1.11.0
func NewCosmosItemFromResponse(value []byte, logger logger.Logger) (item CosmosItem, err error)
type CosmosOperation ¶ added in v1.7.0
type CosmosOperation struct { Item CosmosItem `json:"item"` Type cosmosOperationType `json:"type"` }
CosmosOperation is a wrapper around a CosmosDB operation.
type InternalQuery ¶ added in v1.9.0
type InternalQuery struct {
// contains filtered or unexported fields
}
Internal query object is created here since azcosmos has no notion of a query object
type Query ¶ added in v1.5.0
type Query struct {
// contains filtered or unexported fields
}
type StateStore ¶
StateStore is a CosmosDB state store.
func (*StateStore) BulkGet ¶ added in v1.11.0
func (c *StateStore) BulkGet(ctx context.Context, req []state.GetRequest, _ state.BulkGetOpts) ([]state.BulkGetResponse, error)
BulkGet performs a Get operation in bulk.
func (*StateStore) Close ¶
func (c *StateStore) Close() error
func (*StateStore) Delete ¶
func (c *StateStore) Delete(ctx context.Context, req *state.DeleteRequest) error
Delete performs a delete operation.
func (*StateStore) Features ¶ added in v1.1.1
func (c *StateStore) Features() []state.Feature
Features returns the features available in this state store.
func (*StateStore) Get ¶
func (c *StateStore) Get(ctx context.Context, req *state.GetRequest) (*state.GetResponse, error)
Get retrieves a CosmosDB item.
func (*StateStore) GetComponentMetadata ¶ added in v1.10.1
func (c *StateStore) GetComponentMetadata() (metadataInfo contribmeta.MetadataMap)
func (*StateStore) Multi ¶ added in v0.2.0
func (c *StateStore) Multi(ctx context.Context, request *state.TransactionalStateRequest) (err error)
Multi performs a transactional operation. Succeeds only if all operations succeed, and fails if one or more operations fail. Note that all operations must be in the same partition.
func (StateStore) MultiMaxSize ¶ added in v1.12.0
func (c StateStore) MultiMaxSize() int
MultiMaxSize returns the maximum number of operations allowed in a transaction. For Azure Cosmos DB, that's 100.
func (*StateStore) Query ¶ added in v1.5.0
func (c *StateStore) Query(ctx context.Context, req *state.QueryRequest) (*state.QueryResponse, error)
func (*StateStore) Set ¶
func (c *StateStore) Set(ctx context.Context, req *state.SetRequest) error
Set saves a CosmosDB item.