config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 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"
	IPFSSearchEnabledFlag      = "trigger.ipfs-search.enabled"
	IPFSSearchQueryURLFlag     = "trigger.ipfs-search.query-url"
	DBURIFlag                  = "db.uri"
	NumConcurrentNodesFlag     = "num-concurrent-nodes"
	NumConcurrentWorkflowsFlag = "num-concurrent-workflows"
	MaxWaitingWorkflowsFlag    = "max-waiting-workflows"
	DisableCORSFlag            = "disable-cors"
)

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"`
	Trigger             Trigger       `yaml:"trigger"`
	DB                  DB            `yaml:"db"`
	NodeConcurrency     int           `yaml:"concurrency"`
	WorkflowConcurrency int           `yaml:"workflow-concurrency"`
	MaxWaitingWorkflows int           `yaml:"max-waiting-workflows"`
	DisableCORS         bool          `yaml:"disable-cors"`
}

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 DB added in v0.3.0

type DB struct {
	URI string `yaml:"uri"`
}

type IPFSSearch added in v0.2.0

type IPFSSearch struct {
	Enabled  bool   `yaml:"enabled"`
	QueryURL string `yaml:"query-url"`
}

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) ApplyDefaults added in v0.2.2

func (n *Node) ApplyDefaults()

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"`
}

type Trigger added in v0.2.0

type Trigger struct {
	IPFSSearch IPFSSearch `yaml:"ipfs-search"`
}

Jump to

Keyboard shortcuts

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