mgosec

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: MIT Imports: 7 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(connString string, authMechanism AuthMechanism, conf *tls.Config) (*mgo.Session, error)

Dial dials a MongoDB server with the provided MongoDB connection string, as supplied to the mongo utility, an auth mechanism (see AuthMechanism), and a TLS configuration

func DialInsecure

func DialInsecure(connString string, authMechanism AuthMechanism) (*mgo.Session, error)

DialInsecure dials a MongoDB server with the provided MongoDB connection string, as supplied to the mongo utility, an auth mechanism (see AuthMechanism). Note: this method does not encrypt any information placed on the wire, including authentication details

Types

type AuthMechanism

type AuthMechanism string

AuthMechanism represents a MongoDB authentication mechanism

const (
	//ScramSha1 = SCRAM-SHA-1
	ScramSha1 AuthMechanism = "SCRAM-SHA-1"
	//MongoCR = MONGODB-CR
	MongoCR AuthMechanism = "MONGODB-CR"
	//PlainAuth = PLAIN
	PlainAuth AuthMechanism = "PLAIN"
	//X500 = MONGODB-X500
	X500 AuthMechanism = "MONGODB-X500"
	//GssAPI = GSSAPI
	GssAPI AuthMechanism = "GSSAPI"
	//None is used to show that authentication is disabled
	None AuthMechanism = ""
)

func ParseAuthMechanism

func ParseAuthMechanism(mechanism string) (AuthMechanism, error)

ParseAuthMechanism parses a string representation of a MongoDB authentication mechanism and returns the AuthMechanism which matches

Jump to

Keyboard shortcuts

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