xmlconfig

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 8 Imported by: 0

README

xmlconfig

解析hadoop等相关项目的xml配置文件 xml配置文件格式如下

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>name1</name>
        <value>value1</value>
        <tag>tag1,tag2</tag>
        <description>demo2</description>
    </property>
</configuration>

Documentation

Overview

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type XmlConfig

type XmlConfig struct {
	// contains filtered or unexported fields
}

XmlConfig TODO

func NewXmlConfig added in v1.0.2

func NewXmlConfig() *XmlConfig

NewXmlConfig TODO

func (*XmlConfig) BuildXmlData added in v1.0.4

func (x *XmlConfig) BuildXmlData() ([]byte, error)

BuildXmlData 构建xml配置

func (*XmlConfig) Get

func (x *XmlConfig) Get(key string) (string, error)

Get TODO

func (*XmlConfig) GetBool

func (x *XmlConfig) GetBool(key string, defaultBool bool) bool

GetBool TODO

func (*XmlConfig) GetConfigKeys

func (x *XmlConfig) GetConfigKeys() []string

GetConfigKeys TODO

func (*XmlConfig) GetInt

func (x *XmlConfig) GetInt(key string, defaultInt int) (int, error)

GetInt TODO

func (*XmlConfig) GetInt16

func (x *XmlConfig) GetInt16(key string, defaultInt16 int16) (int16, error)

GetInt16 TODO

func (*XmlConfig) GetInt32

func (x *XmlConfig) GetInt32(key string, defaultInt32 int32) (int32, error)

GetInt32 TODO

func (*XmlConfig) GetInt64

func (x *XmlConfig) GetInt64(key string, defaultInt64 int64) (int64, error)

GetInt64 TODO

func (*XmlConfig) GetInt8

func (x *XmlConfig) GetInt8(key string, defaultInt8 int8) (int8, error)

GetInt8 TODO

func (*XmlConfig) GetPropsWithPrefix

func (x *XmlConfig) GetPropsWithPrefix(prefix string) map[string]string

GetPropsWithPrefix TODO

func (*XmlConfig) GetString

func (x *XmlConfig) GetString(key string, defaultString string) string

GetString TODO

func (*XmlConfig) GetStrings

func (x *XmlConfig) GetStrings(key, sep string) []string

GetStrings TODO

func (*XmlConfig) GetTrimmedString

func (x *XmlConfig) GetTrimmedString(key string, defaultString string) string

GetTrimmedString TODO

func (*XmlConfig) GetTrimmedStrings

func (x *XmlConfig) GetTrimmedStrings(key, sep string) []string

GetTrimmedStrings TODO

func (*XmlConfig) GetUint

func (x *XmlConfig) GetUint(key string, defaultUint uint) (uint, error)

GetUint TODO

func (*XmlConfig) GetUint16

func (x *XmlConfig) GetUint16(key string, defaultUint16 uint16) (uint16, error)

GetUint16 TODO

func (*XmlConfig) GetUint32

func (x *XmlConfig) GetUint32(key string, defaultUint32 uint32) (uint32, error)

GetUint32 TODO

func (*XmlConfig) GetUint64

func (x *XmlConfig) GetUint64(key string, defaultUint64 uint64) (uint64, error)

GetUint64 TODO

func (*XmlConfig) GetUint8

func (x *XmlConfig) GetUint8(key string, defaultUint8 uint8) (uint8, error)

GetUint8 TODO

func (*XmlConfig) ParseXmlData added in v1.0.4

func (x *XmlConfig) ParseXmlData(data []byte) error

ParseXmlData TODO

func (*XmlConfig) Read

func (x *XmlConfig) Read(data []byte, r io.Reader) error

Read 从IO中读取配置

func (*XmlConfig) ReadXmlFile

func (x *XmlConfig) ReadXmlFile(xmlFilePath string) error

ReadXmlFile 从xml文件中读取配置

func (*XmlConfig) SetBool

func (x *XmlConfig) SetBool(key string, value bool)

SetBool TODO

func (*XmlConfig) SetIfUnset

func (x *XmlConfig) SetIfUnset(key string, value string)

SetIfUnset TODO

func (*XmlConfig) SetInt

func (x *XmlConfig) SetInt(key string, value int64)

SetInt TODO

func (*XmlConfig) SetString

func (x *XmlConfig) SetString(key string, value string)

SetString TODO

func (*XmlConfig) SetUint

func (x *XmlConfig) SetUint(key string, value uint64)

SetUint TODO

func (*XmlConfig) String added in v1.0.3

func (x *XmlConfig) String() string

String TODO

func (*XmlConfig) Write

func (x *XmlConfig) Write(w io.Writer) error

Write 将配置信息写入IO

func (*XmlConfig) WriteXmlFile

func (x *XmlConfig) WriteXmlFile(xmlFilePath string) error

WriteXmlFile 将配置信息写入xml文件

Jump to

Keyboard shortcuts

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