couchdb

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCouchDBDatastore

func NewCouchDBDatastore(name string, conn txn.Connector) txn.Datastorer

Types

type ConnectionOptions

type ConnectionOptions struct {
	Address  string
	Username string
	Password string
	DBName   string
}

type CouchDBConnection

type CouchDBConnection struct {
	Address string
	// contains filtered or unexported fields
}

func NewCouchDBConnection

func NewCouchDBConnection(config *ConnectionOptions) *CouchDBConnection

func (*CouchDBConnection) AtomicCreate

func (r *CouchDBConnection) AtomicCreate(name string, value any) (string, error)

func (*CouchDBConnection) ConditionalCommit

func (r *CouchDBConnection) ConditionalCommit(key string, version string) (string, error)

func (*CouchDBConnection) ConditionalUpdate

func (r *CouchDBConnection) ConditionalUpdate(key string, value txn.DataItem, doCreate bool) (string, error)

func (*CouchDBConnection) Connect

func (r *CouchDBConnection) Connect() error

Connect establishes a connection to the CouchDB server and selects database

func (*CouchDBConnection) Delete

func (r *CouchDBConnection) Delete(name string) error

Delete the specified key

func (*CouchDBConnection) Get

func (r *CouchDBConnection) Get(name string) (string, error)

Retrieve the value associated with the given key

func (*CouchDBConnection) GetItem

func (r *CouchDBConnection) GetItem(key string) (txn.DataItem, error)

func (*CouchDBConnection) Put

func (r *CouchDBConnection) Put(name string, value interface{}) error

Store the given value with the specified name (key)

func (*CouchDBConnection) PutItem

func (r *CouchDBConnection) PutItem(key string, value txn.DataItem) (string, error)

type CouchDBDatastore

type CouchDBDatastore struct {
	*txn.Datastore
}

type CouchDBItem

type CouchDBItem struct {
	CKey       string       `json:"Key"`
	CValue     string       `json:"Value"`
	CTxnId     string       `json:"TxnId"`
	CTxnState  config.State `json:"State"`
	CTValid    time.Time    `json:"TValid"`
	CTLease    time.Time    `json:"TLease"`
	CPrev      string       `json:"Prev"`
	CLinkedLen int          `json:"LinkedLen"`
	CIsDeleted bool         `json:"IsDeleted"`
	CVersion   string       `json:"_rev,omitempty"`
}

func NewCouchDBItem

func NewCouchDBItem(options txn.ItemOptions) *CouchDBItem

func (*CouchDBItem) Empty

func (c *CouchDBItem) Empty() bool

func (*CouchDBItem) Equal

func (c *CouchDBItem) Equal(other txn.DataItem) bool

func (*CouchDBItem) IsDeleted

func (c *CouchDBItem) IsDeleted() bool

func (*CouchDBItem) Key

func (c *CouchDBItem) Key() string

func (*CouchDBItem) LinkedLen

func (c *CouchDBItem) LinkedLen() int

func (*CouchDBItem) Prev

func (c *CouchDBItem) Prev() string

func (*CouchDBItem) SetIsDeleted

func (c *CouchDBItem) SetIsDeleted(isDeleted bool)

func (*CouchDBItem) SetLinkedLen

func (c *CouchDBItem) SetLinkedLen(linkedLen int)

func (*CouchDBItem) SetPrev

func (c *CouchDBItem) SetPrev(prev string)

func (*CouchDBItem) SetTLease

func (c *CouchDBItem) SetTLease(tLease time.Time)

func (*CouchDBItem) SetTValid

func (c *CouchDBItem) SetTValid(tValid time.Time)

func (*CouchDBItem) SetTxnState

func (c *CouchDBItem) SetTxnState(state config.State)

func (*CouchDBItem) SetValue

func (c *CouchDBItem) SetValue(value string)

func (*CouchDBItem) SetVersion

func (c *CouchDBItem) SetVersion(version string)

func (*CouchDBItem) String

func (c *CouchDBItem) String() string

func (*CouchDBItem) TLease

func (c *CouchDBItem) TLease() time.Time

func (*CouchDBItem) TValid

func (c *CouchDBItem) TValid() time.Time

func (*CouchDBItem) TxnId

func (c *CouchDBItem) TxnId() string

func (*CouchDBItem) TxnState

func (c *CouchDBItem) TxnState() config.State

func (*CouchDBItem) Value

func (c *CouchDBItem) Value() string

func (*CouchDBItem) Version

func (c *CouchDBItem) Version() string

type CouchDBItemFactory

type CouchDBItemFactory struct{}

func (*CouchDBItemFactory) NewDataItem

func (m *CouchDBItemFactory) NewDataItem(options txn.ItemOptions) txn.DataItem

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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