mongo

package
v0.5.1-0...-18e6f4e Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 12 Imported by: 0

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(cfg config.Config) (pool.StorageInterface, error)

type Storage

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

func NewMongoStorage

func NewMongoStorage(db *mongo.Database) *Storage

func (*Storage) Add

func (m *Storage) Add(node pool.Node, limit int) error

func (*Storage) GetAll

func (m *Storage) GetAll() ([]pool.Node, error)

func (*Storage) GetByAddress

func (m *Storage) GetByAddress(address string) (pool.Node, error)

func (*Storage) GetBySession

func (m *Storage) GetBySession(session string) (pool.Node, error)

func (*Storage) GetCountWithStatus

func (m *Storage) GetCountWithStatus(status *pool.NodeStatus) (int, error)

func (*Storage) Remove

func (m *Storage) Remove(node pool.Node) error

func (*Storage) ReserveAvailable

func (m *Storage) ReserveAvailable(nodeList []pool.Node) (pool.Node, error)

func (*Storage) SetAvailable

func (m *Storage) SetAvailable(node pool.Node) error

func (*Storage) SetBusy

func (m *Storage) SetBusy(node pool.Node, sessionID string) error

func (*Storage) UpdateAddress

func (m *Storage) 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