Documentation
¶
Index ¶
- func NewCouchDBDatastore(name string, conn txn.Connector) txn.Datastorer
- type ConnectionOptions
- type CouchDBConnection
- func (r *CouchDBConnection) AtomicCreate(name string, value any) (string, error)
- func (r *CouchDBConnection) ConditionalCommit(key string, version string) (string, error)
- func (r *CouchDBConnection) ConditionalUpdate(key string, value txn.DataItem, doCreate bool) (string, error)
- func (r *CouchDBConnection) Connect() error
- func (r *CouchDBConnection) Delete(name string) error
- func (r *CouchDBConnection) Get(name string) (string, error)
- func (r *CouchDBConnection) GetItem(key string) (txn.DataItem, error)
- func (r *CouchDBConnection) Put(name string, value interface{}) error
- func (r *CouchDBConnection) PutItem(key string, value txn.DataItem) (string, error)
- type CouchDBDatastore
- type CouchDBItem
- func (c *CouchDBItem) Empty() bool
- func (c *CouchDBItem) Equal(other txn.DataItem) bool
- func (c *CouchDBItem) IsDeleted() bool
- func (c *CouchDBItem) Key() string
- func (c *CouchDBItem) LinkedLen() int
- func (c *CouchDBItem) Prev() string
- func (c *CouchDBItem) SetIsDeleted(isDeleted bool)
- func (c *CouchDBItem) SetLinkedLen(linkedLen int)
- func (c *CouchDBItem) SetPrev(prev string)
- func (c *CouchDBItem) SetTLease(tLease time.Time)
- func (c *CouchDBItem) SetTValid(tValid time.Time)
- func (c *CouchDBItem) SetTxnState(state config.State)
- func (c *CouchDBItem) SetValue(value string)
- func (c *CouchDBItem) SetVersion(version string)
- func (c *CouchDBItem) String() string
- func (c *CouchDBItem) TLease() time.Time
- func (c *CouchDBItem) TValid() time.Time
- func (c *CouchDBItem) TxnId() string
- func (c *CouchDBItem) TxnState() config.State
- func (c *CouchDBItem) Value() string
- func (c *CouchDBItem) Version() string
- type CouchDBItemFactory
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 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 (*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)
type CouchDBDatastore ¶
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) 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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.