Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶ added in v0.5.0
type AuthConfig struct { KeysURL string `split_words:"true" default:"https://auth.rotational.app/.well-known/jwks.json"` Audience string `default:"https://ensign.rotational.app"` Issuer string `default:"https://auth.rotational.app"` MinRefreshInterval time.Duration `split_words:"true" default:"5m"` }
AuthConfig defines how Ensign connects to Quarterdeck in order to authorize requests.
func (AuthConfig) AuthOptions ¶ added in v0.5.0
func (c AuthConfig) AuthOptions() []middleware.AuthOption
type Config ¶
type Config struct { Maintenance bool `default:"false" yaml:"maintenance"` LogLevel logger.LevelDecoder `split_words:"true" default:"info" yaml:"log_level"` ConsoleLog bool `split_words:"true" default:"false" yaml:"console_log"` BindAddr string `split_words:"true" default:":5356" yaml:"bind_addr"` MetaTopic MetaTopicConfig `split_words:"true"` Monitoring MonitoringConfig Storage StorageConfig Auth AuthConfig Radish radish.Config Sentry sentry.Config // contains filtered or unexported fields }
Config contains all of the configuration parameters for an Ensign server and is loaded from the environment or a configuration file with reasonable defaults for values that are omitted. The Config should be validated in preparation for running the Ensign server to ensure that all server operations work as expected.
func New ¶
New creates and processes a Config from the environment ready for use. If the configuration is invalid or it cannot be processed an error is returned.
func (Config) GetLogLevel ¶
Parse and return the zerolog log level for configuring global logging.
func (Config) IsZero ¶
A Config is zero-valued if it hasn't been processed by a file or the environment.
type MetaTopicConfig ¶ added in v0.7.0
type MetaTopicConfig struct { Enabled bool `default:"true" yaml:"enabled"` TopicName string `split_words:"true" default:"ensign.metatopic.topics"` ClientID string `split_words:"true"` ClientSecret string `split_words:"true"` Endpoint string `default:"ensign.rotational.app:443"` AuthURL string `split_words:"true" default:"https://auth.rotational.app"` }
MetaTopicConfig defines the topics and events that the Ensign node publishes along with the credentials and connection endpoints to connect to Ensign on.
func (MetaTopicConfig) Validate ¶ added in v0.7.0
func (c MetaTopicConfig) Validate() error
type MonitoringConfig ¶
type MonitoringConfig struct { Enabled bool `default:"true" yaml:"enabled"` BindAddr string `split_words:"true" default:":1205" yaml:"bind_addr"` NodeID string `split_words:"true" required:"false" yaml:"node"` }
MonitoringConfig maintains the parameters for the o11y server that the Prometheus scraper will fetch the configured observability metrics from.
type StorageConfig ¶ added in v0.4.0
type StorageConfig struct { ReadOnly bool `default:"false" split_words:"true" yaml:"read_only"` DataPath string `split_words:"true" yaml:"data_path"` Testing bool `default:"false" yaml:"testing"` }
StorageConfig defines on disk where Ensign keeps its data. Users must specify the DataPath directory where Ensign will store it's data.
func (StorageConfig) EventPath ¶ added in v0.4.0
func (c StorageConfig) EventPath() (path string, err error)
EventPath returns the path to the event data store for Ensign, checking to make sure that the directory exists and that it is a directory. If it doesn't exist, the directory is created; an error is returned if the path is invalid or cannot be created.
func (StorageConfig) MetaPath ¶ added in v0.4.0
func (c StorageConfig) MetaPath() (path string, err error)
MetaPath returns the path to the metadata store for Ensign, checking to make sure that the directory exists and that it is a directory. If it doesn't exist, the directory is created; an error is returned if the path is invalid or cannot be created.
func (StorageConfig) Validate ¶ added in v0.4.0
func (c StorageConfig) Validate() (err error)