env

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: BSD-3-Clause Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(environment Environment, schema Schema) error

func ParseOS

func ParseOS(schema Schema) error

Types

type Environment

type Environment interface {
	Getenv(string) string
}
var OS Environment = &osEnv{}

type EnvironmentMock

type EnvironmentMock struct {
	GetenvMock mEnvironmentMockGetenv
	// contains filtered or unexported fields
}

EnvironmentMock implements Environment

func NewEnvironmentMock

func NewEnvironmentMock(t minimock.Tester) *EnvironmentMock

NewEnvironmentMock returns a mock for Environment

func (*EnvironmentMock) Getenv

func (mmGetenv *EnvironmentMock) Getenv(s1 string) (s2 string)

Getenv implements Environment

func (*EnvironmentMock) GetenvAfterCounter

func (mmGetenv *EnvironmentMock) GetenvAfterCounter() uint64

GetenvAfterCounter returns a count of finished EnvironmentMock.Getenv invocations

func (*EnvironmentMock) GetenvBeforeCounter

func (mmGetenv *EnvironmentMock) GetenvBeforeCounter() uint64

GetenvBeforeCounter returns a count of EnvironmentMock.Getenv invocations

func (*EnvironmentMock) MinimockFinish

func (m *EnvironmentMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*EnvironmentMock) MinimockGetenvDone

func (m *EnvironmentMock) MinimockGetenvDone() bool

MinimockGetenvDone returns true if the count of the Getenv invocations corresponds the number of defined expectations

func (*EnvironmentMock) MinimockGetenvInspect

func (m *EnvironmentMock) MinimockGetenvInspect()

MinimockGetenvInspect logs each unmet expectation

func (*EnvironmentMock) MinimockWait

func (m *EnvironmentMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type EnvironmentMockGetenvExpectation

type EnvironmentMockGetenvExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

EnvironmentMockGetenvExpectation specifies expectation struct of the Environment.Getenv

func (*EnvironmentMockGetenvExpectation) Then

Then sets up Environment.Getenv return parameters for the expectation previously defined by the When method

type EnvironmentMockGetenvParams

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

EnvironmentMockGetenvParams contains parameters of the Environment.Getenv

type EnvironmentMockGetenvResults

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

EnvironmentMockGetenvResults contains results of the Environment.Getenv

type Parser

type Parser interface {
	Parse(string) error
}

func Bool added in v0.2.3

func Bool(b *bool, required bool) Parser

func Float

func Float(f *float64, required bool) Parser

func Int

func Int(i *int, required bool) Parser

func String

func String(s *string, required bool) Parser

type Schema

type Schema map[Variable]Parser

type Variable

type Variable string

A Variable represents a set environment variable

func (Variable) Name

func (v Variable) Name() string

func (Variable) String

func (v Variable) String() string

Jump to

Keyboard shortcuts

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