couchbase

package
v4.15.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidOperation specified operation is not supported.
	ErrInvalidOperation = errors.New("invalid operation")
	// ErrContentRequired content field is required.
	ErrContentRequired = errors.New("content required")
)
View Source
var ErrInvalidTranscoder = errors.New("invalid transcoder")

ErrInvalidTranscoder specified transcoder is not supported.

Functions

func CacheConfig added in v4.12.0

func CacheConfig() *service.ConfigSpec

CacheConfig export couchbase Cache specification.

func ProcessorConfig

func ProcessorConfig() *service.ConfigSpec

ProcessorConfig export couchbase processor specification.

Types

type Cache added in v4.12.0

type Cache struct {
	// contains filtered or unexported fields
}

Cache stores or retrieves data from couchbase to be used as a cache

func NewCache added in v4.12.0

func NewCache(conf *service.ParsedConfig, mgr *service.Resources) (*Cache, error)

NewCache returns a Couchbase cache.

func (*Cache) Add added in v4.12.0

func (c *Cache) Add(ctx context.Context, key string, value []byte, ttl *time.Duration) error

Add insert into cache.

func (Cache) Close added in v4.12.0

func (p Cache) Close(ctx context.Context) error

func (*Cache) Delete added in v4.12.0

func (c *Cache) Delete(ctx context.Context, key string) error

Delete remove from cache.

func (*Cache) Get added in v4.12.0

func (c *Cache) Get(ctx context.Context, key string) (data []byte, err error)

Get retrieve from cache.

func (*Cache) Set added in v4.12.0

func (c *Cache) Set(ctx context.Context, key string, value []byte, ttl *time.Duration) error

Set update cache.

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor stores or retrieves data from couchbase for each message of a batch.

func NewProcessor

func NewProcessor(conf *service.ParsedConfig, mgr *service.Resources) (*Processor, error)

NewProcessor returns a Couchbase processor.

func (Processor) Close

func (p Processor) Close(ctx context.Context) error

func (*Processor) ProcessBatch

func (p *Processor) ProcessBatch(ctx context.Context, inBatch service.MessageBatch) ([]service.MessageBatch, error)

ProcessBatch applies the processor to a message batch, either creating >0 resulting messages or a response to be sent back to the message source.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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