metagraf

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name        string        `json:"name"`
	Type        string        `json:"type"`
	Description string        `json:"description"`
	Options     []ConfigParam `json:"options,omitempty"`
}

type ConfigParam

type ConfigParam struct {
	Name        string `json:"name"`
	Required    bool   `json:"required"`
	Dynamic     bool   `json:"dynamic,omitempty"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Default     string `json:"default"`
}

type EnvironmentVar

type EnvironmentVar struct {
	Name        string `json:"name"`
	Required    bool   `json:"required"`
	Type        string `json:"type,omitempty"`
	EnvFrom     string `json:"envfrom,omitempty"`
	Description string `json:"description"`
	Default     string `json:"default,omitempty"`
}

type MGVars

type MGVars map[string]string

Map to hold all variables from a specification

type MetaGraf

type MetaGraf struct {
	Kind     string `json:"kind"`
	Metadata struct {
		Name              string            `json:"name"`
		ResourceVersion   string            `json:"resourceversion"`
		Namespace         string            `json:"namespace"`
		CreationTimestamp string            `json:"creationtimestamp,omitempty"`
		Labels            map[string]string `json:"labels,omitempty"`
		Annotations       map[string]string `json:"annotations,omitempty"`
	} `json:"metadata"`
	Spec struct {
		Type         string     `json:"type"`
		Version      string     `json:"version"`
		Description  string     `json:"description"`
		Repository   string     `json:"repository,omitempty"`
		RepSecRef    string     `json:"repsecref,omitempty"`
		Branch       string     `json:"branch,omitempty"`
		BuildImage   string     `json:"buildimage,omitempty"`
		BaseRunImage string     `json:"baserunimage,omitempty"`
		Resources    []Resource `json:"resources,omitempty"`
		Environment  struct {
			Build    []EnvironmentVar `json:"build,omitempty"`
			Local    []EnvironmentVar `json:"local,omitempty"`
			External struct {
				Introduces []EnvironmentVar `json:"introduces,omitempty"`
				Consumes   []EnvironmentVar `json:"consumes,omitempty"`
			} `json:"external,omitempty"`
		} `json:"environment,omitempty"`
		Config []Config `json:"config,omitempty"`
	} `json:"spec"`
}

JSON structure for a MetaGraf entity

func Parse

func Parse(filepath string) MetaGraf

func (*MetaGraf) GetVars

func (mg *MetaGraf) GetVars() MGVars

Returns a map of all parameterized fields in a metaGraf specification. @todo need to look for parameterized fields in more places

type Resource

type Resource struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	External    bool   `json:"external"`
	User        string `json:"user,omitempty"`
	Secret      string `json:"secret,omitempty"`
	SecretType  string `json:"secrettype,omitempty"`
	Semop       string `json:"semop,omitempty"`
	Semver      string `json:"semver,omitempty"`
	Required    bool   `json:"required"`
	Template    string `json:"template,omitempty"`
	Description string `json:"description,omitempty"`
}

Jump to

Keyboard shortcuts

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