mysql

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
}

func (*Factory) Create

func (f *Factory) Create(config config.Config) (pool.StorageInterface, error)

type MysqlCapabilitiesModel

type MysqlCapabilitiesModel struct {
	ID      int    `db:"id"`
	NodeKey string `db:"nodeKey"`
	SetID   string `db:"setId"`
	Name    string `db:"name"`
	Value   string `db:"value"`
}

type MysqlNodeModel

type MysqlNodeModel struct {
	ID         string `db:"id"`
	Key        string `db:"key"`
	Type       string `db:"type"`
	Address    string `db:"address"`
	Status     string `db:"status"`
	SessionID  string `db:"sessionId"`
	Updated    int64  `db:"updated"`
	Registered int64  `db:"registred"`
}

type MysqlStorage

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

func NewMysqlStorage

func NewMysqlStorage(db *sqlx.DB) *MysqlStorage

func (*MysqlStorage) Add

func (s *MysqlStorage) Add(node pool.Node, limit int) error

func (*MysqlStorage) GetAll

func (s *MysqlStorage) GetAll() ([]pool.Node, error)

func (*MysqlStorage) GetByAddress

func (s *MysqlStorage) GetByAddress(address string) (pool.Node, error)

func (*MysqlStorage) GetBySession

func (s *MysqlStorage) GetBySession(sessionID string) (pool.Node, error)

func (*MysqlStorage) GetCountWithStatus

func (s *MysqlStorage) GetCountWithStatus(status *pool.NodeStatus) (int, error)

func (*MysqlStorage) Remove

func (s *MysqlStorage) Remove(node pool.Node) error

func (*MysqlStorage) ReserveAvailable

func (s *MysqlStorage) ReserveAvailable(nodeList []pool.Node) (pool.Node, error)

func (*MysqlStorage) SetAvailable

func (s *MysqlStorage) SetAvailable(node pool.Node) error

func (*MysqlStorage) SetBusy

func (s *MysqlStorage) SetBusy(node pool.Node, sessionID string) error

func (*MysqlStorage) UpdateAddress added in v0.4.0

func (s *MysqlStorage) UpdateAddress(node pool.Node, newAddress string) error

Jump to

Keyboard shortcuts

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