config

package
v0.0.0-...-4685c53 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config parses configuration files

Currently it parses a set of JSON files. The format is:

  {
	"resource": "<name of plugin>",
	"label": "<label for resource>",
	....
  }

The fields names should be strings, and the field values are interpreted as follows:

true, false: boolean
123: integer
123.456: float
"10s": duration
"hello": string
["a", "b", "c"]: list
{"a": 1, "b": 2}: map

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJSONResource

func ParseJSONResource(filesys fs.FS, resource Resource, proto TaskPlugin) (TaskPlugin, error)

ParseJSONResource will return a TaskPlugin given a resource and a prototype

Types

type Resource

type Resource struct {
	Name  string `json:"resource"`
	Label string `json:"label"`
	Path  string `json:"-"`
}

func LoadJSONForPattern

func LoadJSONForPattern(filesys fs.FS, pattern string) ([]Resource, error)

LoadJSONForPattern returns resources for a pattern of JSON files

Jump to

Keyboard shortcuts

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