Documentation ¶
Index ¶
- type API
- func (a *API) Load(path string, dst interface{}) error
- func (a *API) LoadContent(v []byte, dst interface{}, codec Codec) error
- func (a *API) LoadRaw(path string) ([]byte, error)
- func (a *API) LoadWithCodec(path string, dst interface{}, codec Codec) error
- func (a *API) LoadWithReturn(path string, codec Codec) (any, error)
- func (a *API) OpenFile(path string, opts ...Option) (*os.File, error)
- func (a *API) SetRaw(path string, data []byte, opts ...Option) error
- func (a *API) SetRawWithReader(path string, data io.Reader, opts ...Option) error
- func (a *API) SetWithCodec(path string, data any, opts ...Option) error
- type Codec
- type JSON
- type Option
- type RAW
- type TOML
- type YAML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
func (*API) LoadWithCodec ¶ added in v0.1.1
LoadWithCodec loads the file with the specified codec.
If the codec is nil, the codec is determined by the file extension.
func (*API) LoadWithReturn ¶ added in v0.1.2
LoadWithReturn loads the file with the specified codec and returns the result.
func (*API) SetRawWithReader ¶ added in v0.1.4
type Option ¶
type Option func(options *options) error
func WithFilePerm ¶
WithFilePerm sets the file permission.
The permission is a string of octal digits, such as "0644".
func WithFolderPerm ¶
WithFolderPerm sets the folder permission.
The permission is a string of octal digits, such as "0755".
Click to show internal directories.
Click to hide internal directories.