file

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package file file related operations

Index

Constants

This section is empty.

Variables

View Source
var (
	JSONTimeRFC3399Layout = "2006-01-02T15:04:05.999999999Z0700"
)

Functions

func JSONFileToBytes added in v1.1.4

func JSONFileToBytes(pathFile string) ([]byte, error)

func JSONFileToMap added in v1.1.4

func JSONFileToMap(pathFile string) (map[string]interface{}, error)

func JSONGenericMapToBytes

func JSONGenericMapToBytes(input map[string]interface{}) ([]byte, error)

func JSONMerge

func JSONMerge(input [][]byte) ([]byte, error)

func JSONPrettify

func JSONPrettify(input []byte) (*bytes.Buffer, error)

func JSONPrettifyNoError

func JSONPrettifyNoError(input []byte) *bytes.Buffer

func JSONWriteInterface

func JSONWriteInterface(options *JSONWriteInterfaceOptions) ([]byte, error)

func TOMLBytesToJSON

func TOMLBytesToJSON(input []byte) ([]byte, error)

func TOMLBytesToMergedJSON

func TOMLBytesToMergedJSON(bytesSlices [][]byte) ([]byte, error)

func TOMLFileReaderCallbackToJSON added in v1.1.3

func TOMLFileReaderCallbackToJSON(getFileCallback func() (fs.File, error)) ([]byte, error)

func TOMLFileReaderToJSON added in v1.1.3

func TOMLFileReaderToJSON(input fs.File, doClose bool) ([]byte, error)

func TOMLFileToJSON

func TOMLFileToJSON(input string) ([]byte, error)

func TOMLFilesToMergedJSON

func TOMLFilesToMergedJSON(pathFiles []string) ([]byte, error)

func TOMLReaderToJSON

func TOMLReaderToJSON(input io.Reader) ([]byte, error)

func TOMLStringToJSON

func TOMLStringToJSON(input string) ([]byte, error)

func WriteFile

func WriteFile(options *WriteFileOptions) error

Types

type JSONTimeRFC3399

type JSONTimeRFC3399 struct {
	time.Time
}

usage: `json:"time"`

func (*JSONTimeRFC3399) IsSet

func (ct *JSONTimeRFC3399) IsSet() bool

func (*JSONTimeRFC3399) MarshalJSON

func (self *JSONTimeRFC3399) MarshalJSON() ([]byte, error)

func (*JSONTimeRFC3399) UnmarshalJSON

func (self *JSONTimeRFC3399) UnmarshalJSON(b []byte) (err error)

type JSONWriteInterfaceOptions

type JSONWriteInterfaceOptions struct {
	Input    interface{}
	PathFile string
	Pretty   bool
}

type WriteFileOptions

type WriteFileOptions struct {
	PathFile      string
	ContentsBytes []byte
}

Jump to

Keyboard shortcuts

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