environment

package
v0.0.0-...-4877f23 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package environment is a generated GoMock package.

Index

Constants

View Source
const (
	SslPropertySourceName = "SSL_PROPERTY_SOURCE_NAME"
	OsPropertySourceName  = "OS_PROPERTY_SOURCE_NAME"
	CmdPropertySourceName = "CMD_PROPERTY_SOURCE_NAME" //nolint:gosec
)
View Source
const (
	SslServerName        = "SSL_SERVER_NAME"
	SslCaCertificate     = "SSL_CA_CERTIFICATE"
	SslClientCertificate = "SSL_CLIENT_CERTIFICATE"
	SslClientKey         = "SSL_CLIENT_KEY"
)

Variables

This section is empty.

Functions

func AppendPropertySources

func AppendPropertySources(propertySources ...properties.PropertiesSource)

func PropertySources

func PropertySources() []properties.PropertiesSource

Types

type EnvVar

type EnvVar string

func NewEnvVar

func NewEnvVar(value string) EnvVar

func Value

func Value(property string) EnvVar

func ValueOrDefault

func ValueOrDefault(property string, defaultValue string) EnvVar

func (EnvVar) AsInt

func (envVar EnvVar) AsInt() (int, error)

func (EnvVar) AsString

func (envVar EnvVar) AsString() string

type Environment

type Environment interface {
	Value(property string) EnvVar
	ValueOrDefault(property string, defaultValue string) EnvVar
	PropertiesSources() []properties.PropertiesSource
	AppendPropertiesSources(propertySources ...properties.PropertiesSource)
}

func Load

func Load(cmdArgs ...[]string) Environment

func New

func New(options ...Options) Environment

type MockEnvironment

type MockEnvironment struct {
	// contains filtered or unexported fields
}

MockEnvironment is a mock of Environment interface.

func NewMockEnvironment

func NewMockEnvironment(ctrl *gomock.Controller) *MockEnvironment

NewMockEnvironment creates a new mock instance.

func (*MockEnvironment) AppendPropertiesSources

func (m *MockEnvironment) AppendPropertiesSources(propertySources ...properties.PropertiesSource)

AppendPropertiesSources mocks base method.

func (*MockEnvironment) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEnvironment) PropertiesSources

func (m *MockEnvironment) PropertiesSources() []properties.PropertiesSource

PropertiesSources mocks base method.

func (*MockEnvironment) Value

func (m *MockEnvironment) Value(property string) EnvVar

Value mocks base method.

func (*MockEnvironment) ValueOrDefault

func (m *MockEnvironment) ValueOrDefault(property, defaultValue string) EnvVar

ValueOrDefault mocks base method.

type MockEnvironmentMockRecorder

type MockEnvironmentMockRecorder struct {
	// contains filtered or unexported fields
}

MockEnvironmentMockRecorder is the mock recorder for MockEnvironment.

func (*MockEnvironmentMockRecorder) AppendPropertiesSources

func (mr *MockEnvironmentMockRecorder) AppendPropertiesSources(propertySources ...any) *gomock.Call

AppendPropertiesSources indicates an expected call of AppendPropertiesSources.

func (*MockEnvironmentMockRecorder) PropertiesSources

func (mr *MockEnvironmentMockRecorder) PropertiesSources() *gomock.Call

PropertiesSources indicates an expected call of PropertiesSources.

func (*MockEnvironmentMockRecorder) Value

func (mr *MockEnvironmentMockRecorder) Value(property any) *gomock.Call

Value indicates an expected call of Value.

func (*MockEnvironmentMockRecorder) ValueOrDefault

func (mr *MockEnvironmentMockRecorder) ValueOrDefault(property, defaultValue any) *gomock.Call

ValueOrDefault indicates an expected call of ValueOrDefault.

type Options

type Options func(environment Environment)

func NewOptions

func NewOptions() Options

func (Options) WithArraySource

func (options Options) WithArraySource(name string, array []string) Options

func (Options) WithCmd

func (options Options) WithCmd(cmdArgs []string) Options

func (Options) WithOs

func (options Options) WithOs() Options

func (Options) WithPropertySources

func (options Options) WithPropertySources(propertySources ...properties.PropertiesSource) Options

func (Options) WithSSL

func (options Options) WithSSL() Options

type OptionsChain

type OptionsChain struct {
	// contains filtered or unexported fields
}

func OptionsChainBuilder

func OptionsChainBuilder() *OptionsChain

func (*OptionsChain) Build

func (options *OptionsChain) Build() Options

func (*OptionsChain) WithArraySource

func (options *OptionsChain) WithArraySource(name string, array []string) *OptionsChain

func (*OptionsChain) WithCmd

func (options *OptionsChain) WithCmd(cmdArgs []string) *OptionsChain

func (*OptionsChain) WithOs

func (options *OptionsChain) WithOs() *OptionsChain

func (*OptionsChain) WithPropertySources

func (options *OptionsChain) WithPropertySources(propertySources ...properties.PropertiesSource) *OptionsChain

func (*OptionsChain) WithSSL

func (options *OptionsChain) WithSSL() *OptionsChain

Jump to

Keyboard shortcuts

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