cluster

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

func New

func New(size int) *Cluster

func NewFromConfig

func NewFromConfig(conf config.DBConf) *Cluster

func (*Cluster) AddNode

func (c *Cluster) AddNode(conf config.DBConf, host string) error

func (*Cluster) AddNodes

func (c *Cluster) AddNodes(conf config.DBConf)

func (*Cluster) Close

func (c *Cluster) Close()

func (*Cluster) RunWithinTransaction

func (c *Cluster) RunWithinTransaction(tx *sqlx.Tx, fn func(*sqlx.Tx) error) error

RunWithinTransaction runs the passed function using the passed transaction; if nil is passed as tx a new transaction is created. This is basically a wrapper function, that works with a possible nil-tx

func (*Cluster) Transact

func (c *Cluster) Transact(fn func(*sqlx.Tx) error) error

Transact does a database transaction for the passed function

Jump to

Keyboard shortcuts

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