configs

package
v1.0.3-beta Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: GPL-3.0 Imports: 7 Imported by: 15

README

Configs

Small wrapper around the configs directory

Documentation

Index

Constants

View Source
const (
	// APIKeyEnvVar - Name of env variable to pull the cf api key
	APIKeyEnvVar = "CF_API_KEY"
	// APIEmailEnvVar - Name of env variable to pull the cf api email
	APIEmailEnvVar = "CF_API_EMAIL"
)

Variables

This section is empty.

Functions

func GetCloudflareConfigPath

func GetCloudflareConfigPath() string

GetCloudflareConfigPath - File path to config.json

func GetServerConfigPath

func GetServerConfigPath() string

GetServerConfigPath - File path to config.json

Types

type CloudflareConfig

type CloudflareConfig struct {
	// contains filtered or unexported fields
}

CloudflareConfig - Cloudflare configuration values

func GetCloudflareConfig

func GetCloudflareConfig() *CloudflareConfig

GetCloudflareConfig - Get the cloudflare config

func (*CloudflareConfig) Credentials

func (c *CloudflareConfig) Credentials() (string, string)

Credentials - Pulls the CF creds from either the local configuration database

or from the environment variables.

type DaemonConfig

type DaemonConfig struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

DaemonConfig - Configure daemon mode

type LogConfig

type LogConfig struct {
	Level              int  `json:"level"`
	GRPCUnaryPayloads  bool `json:"grpc_unary_payloads"`
	GRPCStreamPayloads bool `json:"grpc_stream_payloads"`
}

LogConfig - Server logging config

type ServerConfig

type ServerConfig struct {
	DaemonMode   bool          `json:"daemon_mode"`
	DaemonConfig *DaemonConfig `json:"daemon"`
	Logs         *LogConfig    `json:"logs"`
}

ServerConfig - Server config

func GetServerConfig

func GetServerConfig() *ServerConfig

GetServerConfig - Get config value

func (*ServerConfig) Save

func (c *ServerConfig) Save() error

Save - Save config file to disk

Jump to

Keyboard shortcuts

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