cosmosdb

package
v1.12.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 22 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCosmosDBStateStore

func NewCosmosDBStateStore(logger logger.Logger) state.Store

NewCosmosDBStateStore returns a new CosmosDB state store.

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
}

func (*Query) Finalize added in v1.5.0

func (q *Query) Finalize(filters string, qq *query.Query) error

func (*Query) VisitAND added in v1.5.0

func (q *Query) VisitAND(f *query.AND) (string, error)

func (*Query) VisitEQ added in v1.5.0

func (q *Query) VisitEQ(f *query.EQ) (string, error)

func (*Query) VisitIN added in v1.5.0

func (q *Query) VisitIN(f *query.IN) (string, error)

func (*Query) VisitOR added in v1.5.0

func (q *Query) VisitOR(f *query.OR) (string, error)

type StateStore

type StateStore struct {
	state.BulkStore
	// contains filtered or unexported fields
}

StateStore is a CosmosDB state store.

func (*StateStore) BulkGet added in v1.11.0

BulkGet performs a Get operation in bulk.

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

Get retrieves a CosmosDB item.

func (*StateStore) GetComponentMetadata added in v1.10.1

func (c *StateStore) GetComponentMetadata() (metadataInfo contribmeta.MetadataMap)

func (*StateStore) Init

func (c *StateStore) Init(ctx context.Context, meta state.Metadata) error

Init does metadata and connection parsing.

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) Ping added in v1.4.4

func (c *StateStore) Ping(ctx context.Context) error

func (*StateStore) Query added in v1.5.0

func (*StateStore) Set

func (c *StateStore) Set(ctx context.Context, req *state.SetRequest) error

Set saves a CosmosDB item.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL