lagoon: sabey.co/lagoon Index | Files

package lagoon

import "sabey.co/lagoon"

Index

Package Files

buffer.go config.go connection.go error.go lagoon.go lagoon_tick.go

Constants

const (
    TICKEVERY_MIN     = time.Second * 5
    TICKEVERY_DEFAULT = time.Second * 15
    TICKEVERY_MAX     = time.Minute
)

Variables

var (
    ERR_CONFIG_NIL              = fmt.Errorf("Config NIL")
    ERR_DIAL_NIL                = fmt.Errorf("Dial NIL")
    ERR_DIAL_INITIAL            = fmt.Errorf("Dial Initial < 0")
    ERR_DIAL_BUFFER_NIL         = fmt.Errorf("Dial Buffer NIL")
    ERR_DIAL_INITIAL_BUFFER_MAX = fmt.Errorf("Dial Initial More Than Buffer Max")
)
var (
    ERR_TIMEDOUT   = fmt.Errorf("Timed-out")
    ERR_DIAL_EMPTY = fmt.Errorf("Dial Available Was Empty!!!")
)

type Buffer Uses

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

func CreateBuffer Uses

func CreateBuffer(
    max int,
    timeout time.Duration,
) *Buffer

func (*Buffer) GetMax Uses

func (self *Buffer) GetMax() int

func (*Buffer) GetTimeout Uses

func (self *Buffer) GetTimeout() time.Duration

type Config Uses

type Config struct {
    Dial        func() (net.Conn, error)
    DialInitial int
    IdleTimeout time.Duration
    TickEvery   time.Duration
    Buffer      *Buffer
}

func (*Config) Clone Uses

func (self *Config) Clone() *Config

func (*Config) IsValid Uses

func (self *Config) IsValid() bool

func (*Config) Validate Uses

func (self *Config) Validate() error

type Connection Uses

type Connection struct {

    // unsafe
    net.Conn
    // contains filtered or unexported fields
}

func (*Connection) Close Uses

func (self *Connection) Close() error

func (*Connection) Disable Uses

func (self *Connection) Disable()

func (*Connection) IsValid Uses

func (self *Connection) IsValid() bool

type Lagoon Uses

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

func CreateLagoon Uses

func CreateLagoon(
    config *Config,
) (
    *Lagoon,
    error,
)

func (*Lagoon) Close Uses

func (self *Lagoon) Close()

func (*Lagoon) CloseActive Uses

func (self *Lagoon) CloseActive()

func (*Lagoon) CloseAvailable Uses

func (self *Lagoon) CloseAvailable()

func (*Lagoon) Connections Uses

func (self *Lagoon) Connections() int

func (*Lagoon) ConnectionsActive Uses

func (self *Lagoon) ConnectionsActive() int

func (*Lagoon) ConnectionsAvailable Uses

func (self *Lagoon) ConnectionsAvailable() int

func (*Lagoon) Dial Uses

func (self *Lagoon) Dial() (
    net.Conn,
    error,
)

func (*Lagoon) DialInitialize Uses

func (self *Lagoon) DialInitialize() error

func (*Lagoon) IsValid Uses

func (self *Lagoon) IsValid() bool

Package lagoon imports 5 packages (graph) and is imported by 2 packages. Updated 2018-09-28. Refresh now. Tools for package owners.