Documentation
¶
Index ¶
- Constants
- Variables
- func CacheConfig() *service.ConfigSpec
- func CommonFields() []*service.ConfigField
- func OutputConfig() *service.ConfigSpec
- func ProcessorConfig() *service.ConfigSpec
- type Cache
- func (c *Cache) Add(ctx context.Context, key string, value []byte, ttl *time.Duration) error
- func (p Cache) Close(ctx context.Context) error
- func (c *Cache) Delete(ctx context.Context, key string) error
- func (c *Cache) Get(ctx context.Context, key string) (data []byte, err error)
- func (c *Cache) Set(ctx context.Context, key string, value []byte, ttl *time.Duration) error
- type Couchbase
- func New(ctx context.Context, conf *service.ParsedConfig, mgr *service.Resources, ...) (*Couchbase, error)
- func NewOutput(ctx context.Context, conf *service.ParsedConfig, mgr *service.Resources) (*Couchbase, error)
- func NewProcessor(ctx context.Context, conf *service.ParsedConfig, mgr *service.Resources) (*Couchbase, error)
- func (p Couchbase) Close(ctx context.Context) error
- func (c *Couchbase) Connect(ctx context.Context) (err error)
- func (c *Couchbase) ProcessBatch(ctx context.Context, inBatch service.MessageBatch) ([]service.MessageBatch, error)
- func (c *Couchbase) WriteBatch(ctx context.Context, inBatch service.MessageBatch) error
Constants ¶
const (
// MetaCASKey holds the CAS value of an entry.
MetaCASKey = "couchbase_cas"
)
Variables ¶
var ( // ErrInvalidOperation specified operation is not supported. ErrInvalidOperation = errors.New("invalid operation") // ErrContentRequired content field is required. ErrContentRequired = errors.New("content required") // ErrBatchError batch error. ErrBatchError = errors.New("batch error") )
var ErrInvalidTranscoder = errors.New("invalid transcoder")
ErrInvalidTranscoder specified transcoder is not supported.
Functions ¶
func CacheConfig ¶
func CacheConfig() *service.ConfigSpec
CacheConfig export couchbase Cache specification.
func CommonFields ¶ added in v1.15.0
func CommonFields() []*service.ConfigField
CommonFields returns the common config fields for the Couchbase client.
func OutputConfig ¶ added in v1.15.0
func OutputConfig() *service.ConfigSpec
OutputConfig export couchbase output specification.
func ProcessorConfig ¶
func ProcessorConfig() *service.ConfigSpec
ProcessorConfig export couchbase processor specification.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache stores or retrieves data from couchbase to be used as a cache
type Couchbase ¶ added in v1.15.0
type Couchbase struct {
// contains filtered or unexported fields
}
Couchbase stores or retrieves data from couchbase for each message of a batch.
func New ¶ added in v1.15.0
func New(ctx context.Context, conf *service.ParsedConfig, mgr *service.Resources, outputMode bool) (*Couchbase, error)
New returns a Couchbase instance.
func NewOutput ¶ added in v1.15.0
func NewOutput(ctx context.Context, conf *service.ParsedConfig, mgr *service.Resources) (*Couchbase, error)
NewOutput returns a Couchbase output.
func NewProcessor ¶
func NewProcessor(ctx context.Context, conf *service.ParsedConfig, mgr *service.Resources) (*Couchbase, error)
NewProcessor returns a Couchbase processor.
func (*Couchbase) ProcessBatch ¶ added in v1.15.0
func (c *Couchbase) 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.
func (*Couchbase) WriteBatch ¶ added in v1.15.0
WriteBatch writes a batch of messages to couchbase.