types

package
v2.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package types contains all defined types

Copyright © 2021 Tonye Jack <jtonye@ymail.com>

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.

Package types contains all defined types

Copyright © 2021 Tonye Jack <jtonye@ymail.com>

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.

Package types contains all defined types

Copyright © 2021 Tonye Jack <jtonye@ymail.com>

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

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	InputFileName      string
	OutputFileName     string
	ColMaxWidth        string
	ColMaxWords        string
	InputColumns       []string
	OutputColumns      []string
	Inputs             map[string]ActionInput  `yaml:"inputs,omitempty"`
	Outputs            map[string]ActionOutput `yaml:"outputs,omitempty"`
	InputMarkdownLinks bool
}

Action represents the action.yml

func (*Action) GetData

func (a *Action) GetData() error

GetData parses the source yaml file

func (*Action) RenderOutput

func (a *Action) RenderOutput() error

RenderOutput renders the output and writes it to the given output

func (*Action) WriteDocumentation

func (a *Action) WriteDocumentation(inputTable, outputTable *strings.Builder) error

WriteDocumentation write the table to the output file

type ActionInput

type ActionInput struct {
	Description        string `yaml:"description"`
	Required           bool   `yaml:"required"`
	Default            string `yaml:"default,omitempty"`
	DeprecationMessage string `yaml:"deprecationMessage,omitempty"`
}

ActionInput represents the input of the action.yml

type ActionOutput

type ActionOutput struct {
	Description string `yaml:"description"`
	Value       string `yaml:"default,omitempty"`
}

ActionOutput represents the output of the action.yml

type Documentation

type Documentation interface {
	GetData() error
	RenderOutput() error
}

Documentation is the interface for Action and Reusable

type Reusable

type Reusable struct {
	InputFileName  string
	OutputFileName string
	ColMaxWidth    string
	ColMaxWords    string
	InputColumns   []string
	OutputColumns  []string
	SecretColumns  []string
	On             struct {
		WorkflowCall struct {
			Inputs  map[string]ReusableInput  `yaml:"inputs,omitempty"`
			Secrets map[string]ReusableSecret `yaml:"secrets,omitempty"`
			Outputs map[string]ReusableOutput `yaml:"outputs,omitempty"`
		} `yaml:"workflow_call"`
	}
	InputMarkdownLinks bool
}

Reusable represents a reusable workflow

func (*Reusable) GetData

func (r *Reusable) GetData() error

GetData parses the source yaml file

func (*Reusable) RenderOutput

func (r *Reusable) RenderOutput() error

RenderOutput renders the output and writes it to the given output

func (*Reusable) WriteDocumentation

func (r *Reusable) WriteDocumentation(inputTable, outputTable, secretsTable *strings.Builder) error

WriteDocumentation write the table to the output file

type ReusableInput

type ReusableInput struct {
	Description        string `yaml:"description"`
	Required           bool   `yaml:"required"`
	Default            string `yaml:"default,omitempty"`
	Type               string `yaml:"type"`
	DeprecationMessage string `yaml:"deprecationMessage,omitempty"`
}

ReusableInput represents the input of the reusable workflow

type ReusableOutput

type ReusableOutput struct {
	Description string `yaml:"description"`
	Value       string `yaml:"value"`
}

ReusableOutput represents the output of the reusable workflow

type ReusableSecret

type ReusableSecret struct {
	Required    bool   `yaml:"required"`
	Description string `yaml:"description"`
}

ReusableSecret represents the secret of reusable workflows

Jump to

Keyboard shortcuts

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