pg_adapter

package
v0.0.0-...-e37bcbf Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionString

type ConnectionString interface {
	GetConnectionString() (string, error)
}

type Db

type Db struct {
	Connection *sqlx.DB
}

func (*Db) Connect

func (db *Db) Connect(connectionString ConnectionString) error

func (*Db) Disconnect

func (db *Db) Disconnect() error

func (Db) Query

func (db Db) Query(query string) (*sql.Rows, error)

type Queues

type Queues struct {
	Id              int    `db:"id"`
	Ip              string `db:"ip"`
	ActiveJobsCount int    `db:"active_jobs_count"`

	NotActiveSince pq.NullTime `db:"not_active_since"`
	CreatedAt      time.Time   `db:"created_at"`
	UpdatedAt      time.Time   `db:"updated_at"`
}

func (Queues) GetIP

func (q Queues) GetIP() net.IPAddr

func (*Queues) Insert

func (q *Queues) Insert(ip net.IPAddr) error

func (Queues) SelectCountOfActive

func (q Queues) SelectCountOfActive() (int, error)

func (Queues) SelectNotActive

func (q Queues) SelectNotActive() ([]net.IPAddr, error)

func (*Queues) SelectTheMostNotLoaded

func (q *Queues) SelectTheMostNotLoaded() error

func (Queues) UpdateActiveJobsCount

func (q Queues) UpdateActiveJobsCount(ip net.IPAddr) error

Jump to

Keyboard shortcuts

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