connection

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection interface {
	FindAll(result interface{}) error
	PipeAll(request, result interface{}) error
}

Collection is an interface that represents the minimum actions needed against a MongoDB collection

type DataLayer

type DataLayer interface {
	C(name string) Collection
	Run(cmd interface{}, result interface{}) error
	CollectionNames() ([]string, error)
}

DataLayer is an interface that represents the minimum actions needed against a MongoDB database

type Info

type Info struct {
	Username              string
	Password              string
	AuthSource            string
	Host                  string
	Port                  string
	Ssl                   bool
	SslCaCerts            string
	PEMKeyFile            string
	Passphrase            string
	SslInsecureSkipVerify bool
}

Info is a storage struct which holds all the information needed to connect to a Mongo host.

func (*Info) CreateSession

func (c *Info) CreateSession() (Session, error)

CreateSession uses the information in ConnectionInfo to return a session connected to a Mongo host

type Session

type Session interface {
	DB(name string) DataLayer
	New(host, port string) (Session, error)
	Info() *Info
	Close()
}

Session is an interface that represents the minimum actions needed against a MongoDB Session.

Jump to

Keyboard shortcuts

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