Documentation ¶
Overview ¶
Package toml declares an adapter for external TOML packages to accommodate for different implementations of data encoders and decoders. This limits the necessary code changes when swapping out implementations. This can possibly leave space for the user to configure the implementation they want to use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTOMLMarshal = errors.New("failed to marshal TOML output")
ErrTOMLMarshal mean an error was raised when marshalling the output.
var ErrTOMLUnmarshal = errors.New("failed to unmarshal TOML input")
ErrTOMLUnmarshal means an error encountered when unmarshalling the input.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter unifies the external TOML library interface to confine any changes to external libraries confined to a particular place in code.
func NewAdapter ¶
func NewAdapter(adapted DecodeEncoder) Adapter
NewAdapter returns the adapted external library TOML functionalities.
type DecodeEncoder ¶
DecodeEncoder defines the combined interface for both decoding and encoding TOML data.
type GoTOML ¶
type GoTOML struct {
// contains filtered or unexported fields
}
GoTOML exposes the go-toml/v2 package functionality to that satisfies the decodeEncoder interface.
func NewGoTOML ¶
func NewGoTOML(c GoTOMLConf) GoTOML
NewGoTOML returns a struct exposing the go-toml/v2 package functionality to that satisfies the decodeEncoder interface.