config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig added in v1.2.0

func InitConfig(opts InitConfigOptions) error

func InitConfigWhenMissing

func InitConfigWhenMissing() error

Types

type Config

type Config struct {
	Discord *DiscordConfig `mapstructure:"discord"`
	Slack   *SlackConfig   `mapstructure:"slack"`
}

Config struct to hold the configuration values

func GetConfig

func GetConfig() (cfg Config, err error)

type Configurer added in v1.1.1

type Configurer interface {
	GetConfig() (cfg Config, err error)
}

func NewConfigurer added in v1.1.1

func NewConfigurer() Configurer

type ConfigurerImpl added in v1.1.1

type ConfigurerImpl struct{}

func (*ConfigurerImpl) GetConfig added in v1.1.1

func (c *ConfigurerImpl) GetConfig() (cfg Config, err error)

type DiscordConfig

type DiscordConfig = WebhookConfig

type InitConfigOptions added in v1.2.0

type InitConfigOptions struct {
	DoNotSkipIfFileExists bool
}

type MockConfigurer added in v1.1.1

type MockConfigurer struct {
	mock.Mock
}

MockConfigurer is an autogenerated mock type for the Configurer type

func NewMockConfigurer added in v1.1.1

func NewMockConfigurer(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockConfigurer

NewMockConfigurer creates a new instance of MockConfigurer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockConfigurer) GetConfig added in v1.1.1

func (_m *MockConfigurer) GetConfig() (Config, error)

GetConfig provides a mock function with given fields:

type SlackConfig added in v1.3.0

type SlackConfig = WebhookConfig

type WebhookConfig added in v1.3.0

type WebhookConfig struct {
	WebhookURL    string `mapstructure:"webhookUrl"`
	MessageFormat string `mapstructure:"messageFormat"`
}

Jump to

Keyboard shortcuts

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