conftype

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSize

type ByteSize int64
const (
	KB ByteSize = 1 << (10 * iota)
	MB
	GB
	TB
	PB
)

func (ByteSize) MarshalJSON

func (b ByteSize) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*ByteSize) ParseString

func (b *ByteSize) ParseString(s string) error

ParseString handles environment variables and default values

func (ByteSize) String

func (b ByteSize) String() string

String implements fmt.Stringer

func (*ByteSize) UnmarshalJSON

func (b *ByteSize) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type Duration

type Duration struct {
	time.Duration
}

Duration is a wrapper around time.Duration that supports JSON marshaling/unmarshaling

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Duration) ParseString

func (d *Duration) ParseString(s string) error

ParseString handles environment variables and default values

func (Duration) String

func (d Duration) String() string

String returns the string representation of the duration Implements the fmt.Stringer interface for pretty printing

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type LogLevel

type LogLevel string
const (
	LogDebug LogLevel = "debug"
	LogInfo  LogLevel = "info"
	LogWarn  LogLevel = "warn"
	LogError LogLevel = "error"
)

func (LogLevel) MarshalJSON

func (l LogLevel) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*LogLevel) ParseString

func (l *LogLevel) ParseString(s string) error

ParseString handles environment variables and default values

func (LogLevel) String

func (l LogLevel) String() string

String implements fmt.Stringer

func (*LogLevel) UnmarshalJSON

func (l *LogLevel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type StringList

type StringList []string

StringList represents a list of strings, typically comma-separated in config

func (StringList) MarshalJSON

func (l StringList) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*StringList) ParseString

func (l *StringList) ParseString(s string) error

ParseString implements StringParser

func (StringList) String

func (l StringList) String() string

String implements fmt.Stringer

func (*StringList) UnmarshalJSON

func (l *StringList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type TCPAddress

type TCPAddress struct {
	Host string
	Port int
}

func (TCPAddress) MarshalJSON

func (a TCPAddress) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (TCPAddress) NetworkAddress

func (a TCPAddress) NetworkAddress() string

NetworkAddress returns the address in host:port format

func (*TCPAddress) ParseString

func (a *TCPAddress) ParseString(s string) error

ParseString handles environment variables and default values

func (TCPAddress) String

func (a TCPAddress) String() string

String implements fmt.Stringer

func (*TCPAddress) UnmarshalJSON

func (a *TCPAddress) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type TimeZone

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

TimeZone represents a validated time zone name

func (TimeZone) Location

func (tz TimeZone) Location() *time.Location

Location returns the time.Location

func (TimeZone) MarshalJSON

func (tz TimeZone) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*TimeZone) ParseString

func (tz *TimeZone) ParseString(s string) error

ParseString handles environment variables and default values

func (TimeZone) String

func (tz TimeZone) String() string

String implements fmt.Stringer

func (*TimeZone) UnmarshalJSON

func (tz *TimeZone) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

Jump to

Keyboard shortcuts

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