config

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	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