config

package
v0.0.0-...-ff78940 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MulanPSL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	ToString() (string, error)
	GetBytes() []byte
}

func ReadConfig

func ReadConfig(r io.Reader) (Config, error)

Read a reader in json format or xml format

func ReadConfigFile

func ReadConfigFile(path string) (Config, error)

Read a file in json format or xml format

type JsonConfig

type JsonConfig struct {
	Json  map[string]interface{}
	Jsonb []byte
}

func (*JsonConfig) GetBytes

func (jc *JsonConfig) GetBytes() []byte

func (*JsonConfig) ToString

func (jc *JsonConfig) ToString() (string, error)

type XmlConfig

type XmlConfig struct {
	Xml  *etree.Document
	Xmlb []byte
}

func (*XmlConfig) GetBytes

func (xml *XmlConfig) GetBytes() []byte

func (*XmlConfig) ToString

func (m *XmlConfig) ToString() (string, error)

Jump to

Keyboard shortcuts

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