mgoimpl

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSelect

func BuildSelect(selectFields []string) bson.M

Types

type DirectSession

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

func (*DirectSession) Get

func (d *DirectSession) Get() *mgo.Session

type Logger

type Logger interface {
	Errorf(string, ...interface{})
}

type PoolConfig

type PoolConfig struct {
	Url string

	Size int

	SocketPoolLimit int

	HealthCheckInterval time.Duration
	RefreshInterval     time.Duration

	LazyInit bool

	Logger Logger
}

type SessionGetter

type SessionGetter interface {
	Get() *mgo.Session
}

func NewDirectSession

func NewDirectSession(dsn string, socketPoolLimit int) (SessionGetter, error)

type SessionPool

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

func NewPool

func NewPool(cfg *PoolConfig) *SessionPool

func NewPoolByUrl

func NewPoolByUrl(url string) *SessionPool

func (*SessionPool) Get

func (p *SessionPool) Get() *mgo.Session

func (*SessionPool) LogErrorf

func (p *SessionPool) LogErrorf(s string, vs ...interface{})

Jump to

Keyboard shortcuts

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