yaml

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: GPL-3.0 Imports: 8 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 struct {
	// contains filtered or unexported fields
}

Config yaml 配置结构

func New

func New(f string) *Config

New 初始化

func (*Config) Fullpath added in v1.3.5

func (c *Config) Fullpath() string

Fullpath 配置文件完整路径

func (*Config) Read

func (c *Config) Read(d interface{}) error

Read 读配置

func (*Config) Write

func (c *Config) Write(d interface{}) error

Write 写配置

type File added in v1.3.5

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

File yaml格式的配置文件

func NewFile added in v1.3.5

func NewFile(filename string) *File

NewFile 创建一个新配置文件

func (*File) AddOrUpdate added in v1.3.5

func (c *File) AddOrUpdate(key, value, tip string)

AddOrUpdate 添加或更新值

func (*File) Load added in v1.3.5

func (c *File) Load(key string) (string, bool)

Load 读取一个值

func (*File) LoadDefault added in v1.3.5

func (c *File) LoadDefault(key, value, tip string) string

LoadDefault 读取一个值,不存在时,使用默认值返回,并添加该键值

func (*File) ReadFile added in v1.3.5

func (c *File) ReadFile() error

ReadFile 读取配置文件

func (*File) Show added in v1.3.5

func (c *File) Show() string

Show 显示全部配置

func (*File) WriteFile added in v1.3.5

func (c *File) WriteFile() error

WriteFile 保存配置到文件

Jump to

Keyboard shortcuts

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