config

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

config Validates and parses user yaml config to Config structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	InputPath  string `yaml:"input"`
	OutputPath string `yaml:"output"`
	Command    string `yaml:"command"`
}

Command represents command from user config

type Config

type Config struct {
	Links     map[string]Link     `yaml:"links"`
	Commands  map[string]Command  `yaml:"commands"`
	Templates map[string]Template `yaml:"templates"`
}

Config represents parsed user config

func Get

func Get(dataYaml []byte, instance string) (*Config, error)

Get validates, parses user yaml data and returns config for given instance.

type Link struct {
	TargetPath string `yaml:"target"`
	LinkPath   string `yaml:"link"`
}

Link represents symbolic link from user config

type Template

type Template struct {
	InputPath  string      `yaml:"input"`
	OutputPath string      `yaml:"output"`
	Data       interface{} `yaml:"data"`
}

Command represents template from user config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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