file

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(sourcePathes []string) (map[string]interface{}, error)

for framework to use. we may want some default configuration.

Types

type File

type File struct {
	Path string
	// Unmarshaller Unmarshaller
	EnableWatch bool
}

local or remote ?

func (*File) Read

func (file *File) Read() (content []byte, err error)

we just implement local file read and format so far.

type JsonFile

type JsonFile struct {
	*File
}

JsonFile 解析json文件

func (*JsonFile) Load

func (jf *JsonFile) Load(sourcePathes []string) (map[string]interface{}, error)

type LocalFile

type LocalFile struct {
	*File
}

func (*LocalFile) Load

func (lf *LocalFile) Load(sourcePathes []string) (map[string]interface{}, error)

type TomlFile

type TomlFile struct {
	*File
}

func (*TomlFile) Load

func (tf *TomlFile) Load(sourcePathes []string) (map[string]interface{}, error)

type Unmarshaller

type Unmarshaller = func([]byte, interface{}) error

if we want abstract the file ... we need it

type YamlFile

type YamlFile struct {
	*File
}

func (*YamlFile) Load

func (yf *YamlFile) Load(sourcePathes []string) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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