template

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright © 2019 Thought Machine

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNonYAMLFileEncountered = errors.New("non-yaml file found in directory")
)

Errors returned from this package

View Source
var TemplateVars = newTemplateVars()

TemplateVars represents the vars that are available in all templates

Functions

func PrepareVars

func PrepareVars(files PipelineYAMLDocs) error

PrepareVars adds contextual vars to the templater

Types

type PatchKindYAMLDocs

type PatchKindYAMLDocs map[string][]jsonpatch.Patch

PatchKindYAMLDocs stores all of the jsonpatch yaml docs found by type

func LoadPatchYAMLFiles

func LoadPatchYAMLFiles(sourcePath string) (PatchKindYAMLDocs, error)

LoadPatchYAMLFiles returns the yaml docs by kind from a given directory

type PipelineParam

type PipelineParam struct {
	Name        string
	Description string
	Type        string

	Value string
}

PipelineParam represents a Parameter in a Pipeline

type PipelineTask

type PipelineTask struct {
	Index int
	Name  string
}

PipelineTask represents a Task in a Pipeline

type PipelineYAMLDocs

type PipelineYAMLDocs map[string]ResourceDocs

PipelineYAMLDocs stores all of the yaml docs found in a file in the format map[path][]doc

func ExecuteFiles

func ExecuteFiles(files PipelineYAMLDocs) (PipelineYAMLDocs, error)

ExecuteFiles executes the templates

func LoadPipelineYAMLFiles

func LoadPipelineYAMLFiles(sourcePath string) (PipelineYAMLDocs, error)

LoadPipelineYAMLFiles returns all of the PipelineYAMLDocs in a directory

type ResourceDoc

type ResourceDoc []byte

ResourceDoc represents a K8s resource document

type ResourceDocs

type ResourceDocs []ResourceDoc

ResourceDocs represents a set of K8s resource documents

func GeneratePipelineResourceDocs

func GeneratePipelineResourceDocs() (ResourceDocs, error)

GeneratePipelineResourceDocs returns the set of unique resource docs for a pipeline

type TypeYAMLDocs

type TypeYAMLDocs map[string][][]byte

TypeYAMLDocs represents a list of resource docs per type in yaml format

func PatchFileYAMLs

func PatchFileYAMLs(
	files PipelineYAMLDocs,
	patches PatchKindYAMLDocs,
) (TypeYAMLDocs, error)

PatchFileYAMLs applies the given patches to files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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