bastion

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequestHandler

func NewRequestHandler(publisher funcie.Publisher) transports.MessageHandler

NewRequestHandler creates a new RequestHandler.

Types

type Config

type Config struct {
	// RedisAddress is the address of the Redis server.
	RedisAddress string `json:"redisAddress"`
	// ListenAddress is the address to listen on.
	ListenAddress string `json:"listenAddress"`
	// RequestTtl indicates the time to live for a request.
	RequestTtl time.Duration `json:"requestTtl"`
	// RequestChannel is the channel to publish requests to.
	RequestChannel string `json:"requestChannel"`
	// ResponseChannel is the channel to listen for responses on.
	ResponseKeyPrefix string `json:"responseKeyPrefix"`
}

Config allows the configuration of the Bastion.

func NewConfig

func NewConfig() *Config

NewConfig creates a new Config with no values set.

func NewConfigFromEnvironment

func NewConfigFromEnvironment() *Config

NewConfigFromEnvironment creates a new Config from environment variables. If any required environment variables are not set, this function will panic with a user-friendly error message. The following environment variables are used:

FUNCIE_REDIS_ADDRESS (required)
FUNCIE_LISTEN_ADDRESS (required)
FUNCIE_REQUEST_TTL (optional; defaults to 15 minutes; values are parsed using time.ParseDuration)
FUNCIE_REQUEST_CHANNEL (optional; defaults to "funcie:requests")
FUNCIE_RESPONSE_KEY_PREFIX (optional; defaults to "funcie:response:")

Jump to

Keyboard shortcuts

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