conf

package
v0.0.0-...-f1cee2f Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package conf provides basic configuration handling from a file exposing a single global struct with all configuration.

Index

Constants

This section is empty.

Variables

View Source
var DefaultHelpMessage = `` /* 1128-byte string literal not displayed */
View Source
var LogWriter *io.PipeWriter

The pipe writer to wrap around standard logger. It is configured in main.

View Source
var Options struct {
	// The type of environment - PROD/TEST/DEV
	Env string
	// The address to listen on
	Address string
	// The HTTP address to listen on if the main address is HTTPS
	HTTPAddress string
	// ExternalAddress to our web tier
	ExternalAddress string
	// Security defintions
	Security struct {
		// The secret session key that is used to symmetrically encrypt sessions stored in cookies
		SessionKey string
		// Session timeout in minutes
		Timeout int
		// Recaptha secret
		Recaptcha string
		// Database encryption key used to encrypt the tokens
		DBKey string
	}
	// SSL configuration
	SSL struct {
		// The certificate file
		Cert string
		// The private key file
		Key string
	}
	// Slack application credentials
	Slack struct {
		// ClientID is passed to the OAuth request
		ClientID string
		// ClientSecret is used to verify Slack reply
		ClientSecret string
	}
	// VT token
	VT string
	// XFE credentials
	XFE struct {
		// Key to access the service
		Key string
		// Password to access the service
		Password string
	}
	// Cy API key
	Cy string
	// AF key
	AF string
	// DB properties
	DB struct {
		// ConnectString how to connect to DB
		ConnectString string
		// Username for the DB
		Username string
		// Password for DB
		Password string
		// ServerCA for TLS
		ServerCA string
		// ClientCert for TLS
		ClientCert string
		// ClientKey for TLS
		ClientKey string
	}
	G struct {
		Project     string
		ConfName    string
		MessageName string
		WorkName    string
		Credentials struct {
			PrivateKeyID string `json:"private_key_id"`
			PrivateKey   string `json:"private_key"`
			ClientEmail  string `json:"client_email"`
			ClientID     string `json:"client_id"`
			Type         string `json:"type"`
		}
	}
	Web       bool
	Worker    bool
	ClamCtl   string
	QueuePoll int
}

Options anonymous struct holds the global configuration options for the server

Functions

func IsDev

func IsDev() bool

IsDev checks if we are running in the development environment.

func Load

func Load(filename string, useDefault bool) error

Load loads configuration from a file. If useDefault is provided then if there is an issue with the file we will use defaults.

Types

This section is empty.

Jump to

Keyboard shortcuts

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