toml

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package toml adds support to marshal and unmarshal types not in the official TOML spec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEnvOverrides

func ApplyEnvOverrides(getenv func(string) string, prefix string, val interface{}) error

Types

type Duration

type Duration time.Duration

Duration is a TOML wrapper type for time.Duration.

func (Duration) MarshalText

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

MarshalText converts a duration to a string for decoding toml

func (*Duration) Set

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

func (Duration) String

func (d Duration) String() string

String returns the string representation of the duration.

func (Duration) Type

func (d Duration) Type() string

func (*Duration) UnmarshalText

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

UnmarshalText parses a TOML value into a duration value.

type FileMode

type FileMode uint32

func (FileMode) MarshalText

func (m FileMode) MarshalText() (text []byte, err error)

func (*FileMode) UnmarshalText

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

type Group

type Group int

func (*Group) UnmarshalTOML

func (g *Group) UnmarshalTOML(data interface{}) error

type Size

type Size uint64

Size represents a TOML parsable file size. Users can specify size using "k" or "K" for kibibytes, "m" or "M" for mebibytes, and "g" or "G" for gibibytes. If a size suffix isn't specified then bytes are assumed.

func (*Size) Set

func (s *Size) Set(d string) error

func (Size) String

func (s Size) String() string

func (Size) Type

func (s Size) Type() string

func (*Size) UnmarshalText

func (s *Size) UnmarshalText(text []byte) error

UnmarshalText parses a byte size from text.

Jump to

Keyboard shortcuts

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