config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRootDir

func GetRootDir() (string, error)

Types

type Config

type Config struct {
	ErrorLevel     errlevel.Level
	Targets        []*Target
	Outputs        []*Output
	ModuleArchives map[string]*ModuleArchive
}

type LintFile

type LintFile struct {
	ID     string
	Path   string         `json:"path"`
	Config map[string]any `json:"config"`
}

type LintGlob

type LintGlob struct {
	Glob   string         `json:"path"`
	Config map[string]any `json:"config"`
}

func (*LintGlob) ToModule

func (lg *LintGlob) ToModule() *ModuleGlob

func (*LintGlob) UnmarshalJSON

func (lg *LintGlob) UnmarshalJSON(b []byte) error

type Module

type Module struct {
	ID        string
	Archive   *ModuleArchive
	SlashPath string
	Config    map[string]interface{}
}

func ParseImport

func ParseImport(line string) (*Module, error)

func (*Module) FilePath

func (m *Module) FilePath() string

type ModuleArchive

type ModuleArchive struct {
	ID        string
	Type      string
	Host      string
	RepoOwner string
	RepoName  string
	Ref       string
	Tag       string
}

func (*ModuleArchive) FilePath

func (m *ModuleArchive) FilePath() string

type ModuleGlob

type ModuleGlob struct {
	ID        string
	SlashPath string
	Archive   *ModuleArchive
	Config    map[string]interface{}
	Excluded  bool
}

func ParseModuleLine

func ParseModuleLine(line string) (*ModuleGlob, error)

type Output

type Output struct {
	ID string `json:"id"`
	// text/template, html/template, jsonnet
	Renderer string `json:"renderer"`
	// path to a template file
	Template string `json:"template"`
	// parameter
	Config map[string]any `json:"config"`
	// Transform parameter
	Transform       string  `json:"transform"`
	TemplateModule  *Module `json:"-"`
	TransformModule *Module `json:"-"`
}

type RawConfig

type RawConfig struct {
	ErrorLevel string       `json:"error_level"`
	Targets    []*RawTarget `json:"targets"`
	Outputs    []*Output    `json:"outputs,omitempty"`
}

func (*RawConfig) Parse

func (rc *RawConfig) Parse() (*Config, error)

type RawModule

type RawModule struct {
	Glob   string         `json:"path"`
	Config map[string]any `json:"config"`
}

func (*RawModule) Parse

func (rm *RawModule) Parse() (*ModuleGlob, error)

func (*RawModule) UnmarshalJSON

func (rm *RawModule) UnmarshalJSON(b []byte) error

type RawTarget

type RawTarget struct {
	ID        string       `json:"id,omitempty"`
	LintGlobs []*LintGlob  `json:"lint_files"`
	Modules   []*RawModule `json:"modules"`
	DataFiles []string     `json:"data_files"`
	Combine   bool         `json:"combine,omitempty"`
}

func (*RawTarget) Parse

func (rt *RawTarget) Parse() (*Target, error)

type Target

type Target struct {
	ID             string
	LintFiles      []*ModuleGlob
	Modules        []*ModuleGlob
	ModuleArchives map[string]*ModuleArchive
	DataFiles      []string
	Combine        bool
}

Jump to

Keyboard shortcuts

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