shared

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EnabledGroups is map with the group name as field and a boolean indicating wether that group is enabled or not.
	EnabledGroups = make(map[string]bool)
)

Functions

func IsVersionGreater

func IsVersionGreater(version string, major int, minor int, release int) bool

func LoadCaFrom added in v0.2.0

func LoadCaFrom(pemFile string) (*x509.CertPool, error)

func LoadKeyPairFrom added in v0.2.0

func LoadKeyPairFrom(pemFile string, privateKeyPemFile string) (tls.Certificate, error)

func MongoSession

func MongoSession(opts MongoSessionOpts) *mgo.Session

func MongoSessionNodeType

func MongoSessionNodeType(session *mgo.Session) (string, error)

func MongoSessionServerVersion

func MongoSessionServerVersion(session *mgo.Session) (string, error)

func ParameterizeString

func ParameterizeString(text string) string

ParameterizeString parameterizes the given string.

func ParseEnabledGroups

func ParseEnabledGroups(enabledGroupsFlag string)

ParseEnabledGroups parses the groups passed by the command line input.

func RedactMongoUri added in v0.2.0

func RedactMongoUri(uri string) string

func SnakeCase

func SnakeCase(text string) string

SnakeCase converts the given text to snakecase/underscore syntax.

Types

type MongoSessionOpts added in v0.2.0

type MongoSessionOpts struct {
	URI                   string
	TLSConnection         bool
	TLSCertificateFile    string
	TLSPrivateKeyFile     string
	TLSCaFile             string
	TLSHostnameValidation bool
}

Jump to

Keyboard shortcuts

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