encoding

package
v0.75.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCouldNotMarshalFLM is to be used when marshalling failed.
	ErrCouldNotMarshalFLM = errors.New("could not marshal FileLoadingMode value to string")
	// ErrCouldNotUnmarshalFLM is to be used when unmarshalling failed.
	ErrCouldNotUnmarshalFLM = errors.New("could not unmarshal FileLoadingMode value from string")
)

Functions

This section is empty.

Types

type Base64

type Base64 []byte

func (Base64) MarshalFlag

func (b Base64) MarshalFlag() (string, error)

func (*Base64) UnmarshalFlag

func (b *Base64) UnmarshalFlag(s string) error

type Bool

type Bool bool

func (*Bool) UnmarshalFlag

func (b *Bool) UnmarshalFlag(s string) error

type Duration

type Duration struct {
	time.Duration
}

Duration is a wrapper over an actual duration so we can represent them as string in the toml configuration.

func (*Duration) Get

func (d *Duration) Get() time.Duration

Get returns the stored duration.

func (Duration) MarshalFlag

func (d Duration) MarshalFlag() (string, error)

func (Duration) MarshalText

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

MarshalText marshal a duraton into bytes.

func (*Duration) UnmarshalFlag

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

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText unmarshal a duration from bytes.

type FileLoadingMode

type FileLoadingMode struct {
	options.FileLoadingMode
}

FileLoadingMode is for storing a badger.FileLoadingMode as a string in a config file.

func (*FileLoadingMode) Get

Get returns the underlying FileLoadingMode.

func (FileLoadingMode) MarshalText

func (m FileLoadingMode) MarshalText() ([]byte, error)

MarshalText maps a FileLoadingMode enum value to a string.

func (*FileLoadingMode) UnmarshalText

func (m *FileLoadingMode) UnmarshalText(text []byte) error

UnmarshalText maps a string to a FileLoadingMode enum value.

type LogLevel

type LogLevel struct {
	logging.Level
}

LogLevel is wrapper over the actual log level so they can be specified as strings in the toml configuration.

func (*LogLevel) Get

func (l *LogLevel) Get() logging.Level

Get return the store value.

func (LogLevel) MarshalText

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

MarshalText marshal a loglevel into bytes.

func (*LogLevel) UnmarshalFlag

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

func (*LogLevel) UnmarshalText

func (l *LogLevel) UnmarshalText(text []byte) error

UnmarshalText unmarshal a loglevel from bytes.

Jump to

Keyboard shortcuts

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