couchbase

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyBuckets = errors.New("empty buckets")
)
View Source
var Module = types.Module{
	{CreateFunc: NewConfig},
	{CreateFunc: NewCouchbase},
}

Functions

This section is empty.

Types

type Collection

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

func (*Collection) CallContext

func (c *Collection) CallContext(
	ctx context.Context,
	query string,
	f func(ctx context.Context, collection *gocb.Collection) error,
) error

func (*Collection) CallTransaction

func (c *Collection) CallTransaction(
	ctx context.Context,
	query string,
	f func(ctx context.Context, c *txtype.CollectionTx) error,
) error

type Config

type Config struct {
	DSN         string
	User        string
	Password    string
	Buckets     []string
	AppName     string
	EnableDebug bool
}

func NewConfig

func NewConfig(cfg *config.Config) Config

type Couchbase

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

func NewCouchbase

func NewCouchbase(l *zap.Logger, cfg Config) (*Couchbase, error)

func (*Couchbase) GetCollection

func (c *Couchbase) GetCollection(bucketName, collectionName string) (connectors.DBConnector[*gocb.Collection, *txtype.CollectionTx], error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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