templates

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GroupAPI is the group API scope use in this package
	GroupAPI = "sxlimits.k8s.startx.fr"
	// GroupName is the group name use in this package
	GroupName = "template"
)

Variables

This section is empty.

Functions

func DisplayHelpCmdTemplate

func DisplayHelpCmdTemplate()

DisplayHelpCmdTemplate display the help message for the subcommand template

Types

type Template

type Template struct {
	// contains filtered or unexported fields
}

Template represents a template class

func NewTemplate

func NewTemplate(name, desc, content string, enabled bool) *Template

NewTemplate creates a new instance of Template

func (*Template) GenerateLimitRange added in v0.0.3

func (t *Template) GenerateLimitRange(name string) (v1.LimitRange, error)

Generate a new The name of the limitrange from the template

func (*Template) GenerateLimitRangeYaml added in v0.0.3

func (t *Template) GenerateLimitRangeYaml(name string) (string, error)

Generatea new The name of the limitrange from the template

func (*Template) GetContent

func (t *Template) GetContent() string

GetContent returns the content property of the template

func (*Template) GetContentObj

func (t *Template) GetContentObj() (*v1.LimitRange, error)

GetContentYaml returns the content property as a string byte

func (*Template) GetContentYaml

func (t *Template) GetContentYaml() []byte

GetContentYaml returns the content property as a string byte

func (*Template) GetDesc

func (t *Template) GetDesc() string

GetDesc returns the desc property of the template

func (*Template) GetEnabled

func (t *Template) GetEnabled() bool

GetEnabled returns the enabled property of the template

func (*Template) GetInfo

func (t *Template) GetInfo()

Display show the template

func (*Template) GetName

func (t *Template) GetName() string

GetName returns the name property of the template

func (*Template) SetContent

func (t *Template) SetContent(content string)

SetContent sets the content property of the template

func (*Template) SetDesc

func (t *Template) SetDesc(desc string)

SetDesc sets the desc property of the template

func (*Template) SetEnabled

func (t *Template) SetEnabled(enabled bool)

SetEnabled sets the enabled property of the template

func (*Template) SetName

func (t *Template) SetName(name string)

SetName sets the name property of the template

type TemplateStack

type TemplateStack struct {
	// contains filtered or unexported fields
}

TemplateStack represents a stack of Template objects

func NewTemplateStack

func NewTemplateStack() *TemplateStack

NewTemplateStack creates a new instance of TemplateStack

func (*TemplateStack) AddTemplate

func (ts *TemplateStack) AddTemplate(template *Template)

AddTemplate adds a template to the stack

func (*TemplateStack) DisplayTemplate

func (ts *TemplateStack) DisplayTemplate(name string)

displayTemplate show the template stack

func (*TemplateStack) DisplayTemplateInfo

func (ts *TemplateStack) DisplayTemplateInfo(name string)

displayTemplate show the template stack

func (*TemplateStack) DisplayTemplates

func (ts *TemplateStack) DisplayTemplates()

displayTemplate show the template stack

func (*TemplateStack) GetTemplate

func (ts *TemplateStack) GetTemplate(name string) (*Template, error)

displayTemplate show the template stack

func (*TemplateStack) RemoveTemplate

func (ts *TemplateStack) RemoveTemplate(name string) error

RemoveTemplate removes a template from the stack

func (*TemplateStack) UpdateTemplate

func (ts *TemplateStack) UpdateTemplate(name string, updatedTemplate *Template) error

UpdateTemplate updates an existing template in the stack

Jump to

Keyboard shortcuts

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