config

package module
v0.0.0-...-553f1c6 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigDir

func GetConfigDir() (string, error)

GetConfigDir returns the configuration directory

Types

type AppConfig

type AppConfig struct {
	// Version
	Version string `json:"version"`
	// Name
	Name string `json:"name"`
	// Notice Message.
	Notice string `json:"notice"`
}

func Load

func Load() (AppConfig, error)

Load Configuration JSON

type CertstreamConfig

type CertstreamConfig struct {
	Mode string `mapstructure:"mode"`
}

CertstreamConfig is the configuration struct for certstream

type Config

type Config struct {
	Log    LogConfig    `mapstructure:"log"`
	Stream StreamConfig `mapstructure:"stream"`
	OpenAI OpenAIConfig `mapstructure:"openai"`
}

Config is the configuration struct

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig loads the configuration from a YAML file

type LogConfig

type LogConfig struct {
	// Certwatcher logs file
	File string `mapstructure:"file"`
	// Debug Level set default to Info
	Level string `mapstructure:"level"`
}

LogConfig is the configuration struct for logging

type OpenAIConfig

type OpenAIConfig struct {
	APIKey string `yaml:"apikey"`
}

type StreamConfig

type StreamConfig struct {
	Certstream CertstreamConfig `mapstructure:"certstream"`
	// List of domains to filter
	// Filters in the interaction with the issued certificates.
	// examples:
	//   - value: >
	//       []string{"www.example.com", "*.test.com"}
	Domains []string `mapstructure:"domains"`
	// This function is true the domains will be ignored
	// Default ignore is false
	// examples:
	// - ignore: true
	Ignore bool `mapstructure:"ignore"`
}

StreamConfig is the configuration struct for stream

Jump to

Keyboard shortcuts

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