config

package
v0.0.0-...-12a582f Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNodeHost = "127.0.0.1:8332"

	DefaultSettingsPathName = ".btc-cloudkit"
)
View Source
const (
	// DefaultThing
	DefaultThing = "defaultThing"

	// LambdaStuff
	LambdaServerPortKey     = "_LAMBDA_SERVER_PORT"
	DefaultLambdaServerPort = "8181"

	// Filesystem Stuff
	// DefaultProvider is the default provider to use
	// if no config is provided to override the default
	// when deploying the service, or sent with a header
	// that lets a single request
	DefaultProvider = "aws/s3"

	// DefaultNamespace is the default key/filepath prefix to
	// namespace files to, it can be logs/files/data
	DefaultNamespace = "files"

	// MaxFileCount is the max number of files allowed
	// in any single upload
	MaxFileCount = 5

	DefaultSSHKeyName = "cloudkit-ssh-key"
)
View Source
const (
	SettingsDirName = ".btc-cloudkit"
)

Variables

This section is empty.

Functions

func Exists

func Exists(path string) (bool, error)

Exists test if any settings file exists

func SetLambdaRuntimeDefaults

func SetLambdaRuntimeDefaults()

Types

type AWS

type AWS struct {
	// Storage Configurations
	DynamoDBTablePrefix string `mapstructure:"dynamodbTablePrefix"`
}

type Config

type Config struct {
	Verbosity    string `mapstructure:"verbosity"`
	LogFormatter string `mapstructure:"logFormatter"`

	DefaultNamespace string `mapstructure:"defaultNamespace"`

	// DefaultPlatform (optional) is the default platform
	// to target when creating resources, vs defaulting the to
	// default enum (ie: TARGET_AWS_UNSPECIFIED) an override can be
	// configured  here by the deployment operator to target some other
	// target (eg: DigitalOcean)
	DefaultPlatform string `mapstructure:"digitalOceanToken"`

	DigitalOceanToken  string `mapstructure:"digitalOceanToken"`
	CloudflareAPIToken string `mapstructure:"cloudflareApiToken"`

	// Server stuff
	Listen             string `mapstructure:"listen"`
	GRPCListen         string `mapstructure:"grpcListen"`
	GRPCGatewayListen  string `mapstructure:"grpcGatewayListen"`
	GRPCGatewayEnabled bool   `mapstructure:"grpcGatewayEnabled"`

	Node    Node         `mapstructure:"node"`
	Streams StreamConfig `mapstructure:"streams"`

	// Notifications
	Notifications Notifications `mapstructure:"notifications"`

	// Environment
	Environment string `mapstructure:"environment"`

	// ApiKey
	EnableApiKey bool   `mapstructure:"enableApiKey"`
	APIKey       string `mapstructure:"apiKey"`
	SSHPrivKey   string `mapstructure:"sshPrivKey"`
	SSHKeyPath   string `mapstructure:"sshKeyPath"`
	SSHKeyName   string `mapstructure:"sshKeyName"`

	// Redis / MemoryDB stuff for presence and key management
	RedisHost     string `mapstructure:"redisHost"`
	RedisPassword string `mapstructure:"redisPassword"`
	RedisDB       int    `mapstructure:"redisDB"`

	EventPublisherName        string `mapstructure:"eventPublisherName"`
	EventPublisherARN         string `mapstructure:"eventPublisherARN"`
	EventPublisherSQSQueueURL string `mapstructure:"eventPublisherSQSQueueURL"`

	// Publishers
	RabbitMQ RabbitMQConfig `mapstructure:"rmq"`

	AWS AWS `mapstructure:"aws"`

	// Lightning implementations
	LND    lightning.LNDConfig    `mapstructure:"lnd"`
	Eclair lightning.EclairConfig `mapstructure:"eclair"`
}

Config stores all service configuration that can be injected via ENV var or falls back to defaults

func Read

func Read() *Config

Read returns an instance of config, initializing it only once ever, handling settings defaults and binding ENV vars to structural config values

type Node

type Node struct {
	Host        string `mapstructure:"host"`
	NodeType    string `mapstructure:"type"`
	RPCUser     string `mapstructure:"rpcUser"`
	RPCPassword string `mapstructure:"rpcPassword"`
}

type Notifications

type Notifications struct {
	WebhookURL                string `mapstructure:"webhookUrl"`
	SNSTopicArn               string `mapstructure:"snsTopicArn"`
	SQSEventsQueue            string `mapstructure:"sqsEventsQueue"`
	AllowWebsocketSubscribers bool   `mapstructure:"allowWebsocketSubscribers"`
}

type RabbitMQConfig

type RabbitMQConfig struct {
	URL          string `mapstructure:"URL"`
	QueueName    string `mapstructure:"QueueName"`
	ExchangeName string `mapstructure:"ExchangeName"`
	Mandatory    bool   `mapstructure:"Mandatory"`
	Immediate    bool   `mapstructure:"Immediate"`
	DeliveryMode int    `mapstructure:"DeliveryMode"`
	ContentType  string `mapstructure:"ContentType"`
	AutoAck      bool   `mapstructure:"AutoAck"`

	// Optional
	Durable    bool `mapstructure:"Durable"`
	AutoDelete bool `mapstructure:"AutoDelete"`
	Exclusive  bool `mapstructure:"Exclusive"`
	NoWait     bool `mapstructure:"NoWait"`
}

type StreamConfig

type StreamConfig struct {
	ZeroMqListenAddr string `mapstructure:"zeroMQListenAddr"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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