config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config models the configuration file for Amplify

Index

Constants

View Source
const (
	LogLevelFlag   = "log-level"
	ConfigPathFlag = "config"
	PortFlag       = "port"
)

Define all global flag names

Variables

This section is empty.

Functions

func AddGlobalFlags

func AddGlobalFlags(cmd *cobra.Command)

func InitViper

func InitViper(cmd *cobra.Command) (*viper.Viper, error)

Types

type AppConfig

type AppConfig struct {
	LogLevel   zerolog.Level `yaml:"log-level"`
	ConfigPath string        `yaml:"config-path"`
	Port       int           `yaml:"port"`
}

func ParseAppConfig

func ParseAppConfig(cmd *cobra.Command) *AppConfig

type Config

type Config struct {
	Jobs  []Job  `yaml:"jobs"`
	Graph []Node `yaml:"graph"`
}

func GetConfig

func GetConfig(path string) (*Config, error)

type Job

type Job struct {
	ID            string   `yaml:"id"`
	Type          string   `yaml:"type"`
	InternalJobID string   `yaml:"internal_job_id"`
	Image         string   `yaml:"image"`
	Entrypoint    []string `yaml:"entrypoint"`
}

type Node

type Node struct {
	ID      string       `yaml:"id"`
	JobID   string       `yaml:"job_id"`
	Inputs  []NodeInput  `yaml:"inputs"`
	Outputs []NodeOutput `yaml:"outputs"`
}

func (Node) IsRoot added in v0.1.1

func (n Node) IsRoot() bool

type NodeInput

type NodeInput struct {
	Root      bool   `yaml:"root"`
	NodeID    string `yaml:"node_id"`
	OutputID  string `yaml:"output_id"`
	Path      string `yaml:"path"`
	Predicate string `yaml:"predicate"`
}

type NodeOutput

type NodeOutput struct {
	ID   string `yaml:"id"`
	Path string `yaml:"path"`
}

Jump to

Keyboard shortcuts

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