marsutils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromString

func FromString(content string, model interface{}, filetype Type) error

func ReadFile

func ReadFile(filepath string, model interface{}, filetype Type) error

func ToString

func ToString(model interface{}, filetype Type) (string, error)

func WriteFile

func WriteFile(filepath string, model interface{}, filetype Type) error

Types

type Type

type Type int
const (
	XML  Type = iota
	JSON Type = iota
	TOML Type = iota
	YAML Type = iota
)

func (Type) Marshal

func (t Type) Marshal() func(model interface{}) ([]byte, error)

func (Type) Unmarshal

func (t Type) Unmarshal() func(data []byte, model interface{}) error

Jump to

Keyboard shortcuts

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