parser

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// FileTOML toml
	FileTOML = ".toml"

	// FileJSON  json
	FileJSON = ".json"
)

Variables

TOML toml配置格式解析

Functions

func HeadComments added in v0.2.2

func HeadComments(input []byte) []string

HeadComments 获取头部的所有注释内容

func JSON

func JSON(txt []byte, obj any) error

JSON .json 文件的解析方法 若内容以 # 开头,则该为注释

func StripComment

func StripComment(input []byte) (out []byte)

StripComment 去除单行的'#'注释 只支持单行,不支持行尾

Types

type Fn

type Fn func(bf []byte, obj any) error

Fn 对应文件后缀的配置解析方法

Jump to

Keyboard shortcuts

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