config

package
v0.0.0-...-6b3cdd0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// SafeVarName is used to remove special chars from paths
	SafeVarName = regexp.MustCompile(`[^a-zA-Z0-9]`)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Dest     string
	NoPrefix bool

	Pkg         string
	Fmt         bool // gofmt
	Compression *compression.Options
	Tags        string

	Output string

	Custom []custom.Custom

	Spread     bool
	Unexported bool
	Clean      bool
	Debug      bool
	Updater    updater.Config
	Lcf        bool
}

Config holds the json/yaml/toml data

func (*Config) Defaults

func (cfg *Config) Defaults() error

Defaults set the default value for some variables

type File

type File struct {
	FilePath string
	Data     []byte
	Mode     string // "json" || "yaml" || "yml" || "toml"
}

File holds config file info

func (*File) FromArg

func (f *File) FromArg(read bool) error

FromArg gets the json/yaml/toml file from args

func (*File) Load

func (f *File) Load() (*Config, error)

Load the json/yaml file that was specified from args and transform it into a config struct

func (*File) Parse

func (f *File) Parse() (*Config, error)

Parse gets the config file's content from File.Data

func (*File) RemoveJSONComments

func (f *File) RemoveJSONComments()

RemoveJSONComments from the file

Jump to

Keyboard shortcuts

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