init

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YAML = "yaml"
	JSON = "json"
	TOML = "toml"
)

Variables

This section is empty.

Functions

func Generate

func Generate(_type, _path string, name, version, author, description, repository string) error

Types

type ConfigTemplate

type ConfigTemplate struct {
	Name    string `json:"name" yaml:"name" toml:"name"`
	Version string `json:"version" yaml:"version" toml:"version"`

	Author      interface{} `json:"author" yaml:"author" toml:"author"`
	Description string      `json:"description" yaml:"description" toml:"description"`
	Repository  string      `json:"repository" yaml:"repository" toml:"repository"`

	Env    string   `json:"env" yaml:"env" toml:"env"`
	Target []string `json:"target" yaml:"target" toml:"target"`

	Scripts  map[string]string `json:"scripts" yaml:"scripts" toml:"scripts"`
	Packages map[string]string `json:"packages" yaml:"packages" toml:"packages"`
}

func GetConfigStruct

func GetConfigStruct(name, version, author, description, repository string) *ConfigTemplate

func Parse

func Parse(_type, _path string) (*ConfigTemplate, error)

type Generator

type Generator struct {
	Config *ConfigTemplate
}

func (*Generator) ToJson

func (g *Generator) ToJson() ([]byte, error)

func (*Generator) ToToml

func (g *Generator) ToToml() ([]byte, error)

func (*Generator) ToYaml

func (g *Generator) ToYaml() ([]byte, error)

type Parser

type Parser struct {
	Data []byte
}

func (*Parser) FromJson

func (p *Parser) FromJson() (*ConfigTemplate, error)

func (*Parser) FromToml

func (p *Parser) FromToml() (*ConfigTemplate, error)

func (*Parser) FromYaml

func (p *Parser) FromYaml() (*ConfigTemplate, error)

Jump to

Keyboard shortcuts

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