settersutil

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldSetter

type FieldSetter struct {
	// Name is the name of the setter to set
	Name string

	// Value is the value to set
	Value string

	Description string

	SetBy string
}

FieldSetter sets the value for a field setter.

func (FieldSetter) Set

func (fs FieldSetter) Set(openAPIPath, resourcesPath string) (int, error)

Set updates the OpenAPI definitions and resources with the new setter value

type SetterCreator

type SetterCreator struct {
	// Name is the name of the setter to create or update.
	Name string

	Description string

	SetBy string

	// FieldName if set will add the OpenAPI reference to fields with this name or path
	// FieldName may be the full name of the field, full path to the field, or the path suffix.
	// e.g. all of the following would match spec.template.spec.containers.image --
	// [image, containers.image, spec.containers.image, template.spec.containers.image,
	//  spec.template.spec.containers.image]
	// Optional.  If unspecified match all field names.
	FieldName string

	// FieldValue if set will add the OpenAPI reference to fields if they have this value.
	// Optional.  If unspecified match all field values.
	FieldValue string
}

SetterCreator creates or updates a setter in the OpenAPI definitions, and inserts references to the setter from matching resource fields.

func (SetterCreator) Create

func (c SetterCreator) Create(openAPIPath, resourcesPath string) error

type SubstitutionCreator

type SubstitutionCreator struct {
	// Name is the name of the substitution to create
	Name string

	// Pattern is the substitution pattern
	Pattern string

	// Values are the substitution values for the pattern
	Values []setters2.Value

	// FieldName if set will add the OpenAPI reference to fields with this name or path
	// FieldName may be the full name of the field, full path to the field, or the path suffix.
	// e.g. all of the following would match spec.template.spec.containers.image --
	// [image, containers.image, spec.containers.image, template.spec.containers.image,
	//  spec.template.spec.containers.image]
	// Optional.  If unspecified match all field names.
	FieldName string

	// FieldValue if set will add the OpenAPI reference to fields if they have this value.
	// Optional.  If unspecified match all field values.
	FieldValue string
}

SubstitutionCreator creates or updates a substitution in the OpenAPI definitions, and inserts references to the substitution from matching resource fields.

func (SubstitutionCreator) Create

func (c SubstitutionCreator) Create(openAPIPath, resourcesPath string) error

Jump to

Keyboard shortcuts

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