shared

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: MIT Imports: 10 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 LoadCertificatesFrom

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

LoadCertificatesFrom returns certificates for a given pem file

func LoadKeyPairFrom

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

LoadKeyPairFrom returns a configured TLS certificate

func MongoSession

func MongoSession(opts MongoSessionOpts) *mgo.Session

MongoSession creates a Mongo session

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 SnakeCase

func SnakeCase(text string) string

SnakeCase converts the given text to snakecase/underscore syntax.

Types

type MongoSessionOpts

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

MongoSessionOpts represents options for a Mongo session

Jump to

Keyboard shortcuts

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