resource

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResourceMapping added in v0.23.0

func GetResourceMapping() map[string]interface{}

Need to do reflect of ResourceConfig

Types

type Resource

type Resource interface {
	Source(workingDir string) (string, error)
	Condition(version string) (bool, error)
	ConditionFromSCM(version string, scm scm.ScmHandler) (bool, error)
	Target(source string, dryRun bool) (bool, error)
	TargetFromSCM(source string, scm scm.ScmHandler, dryRun bool) (changed bool, files []string, message string, err error)
	Changelog() string
}

Resource allow to manipulate a resource that can be a source, a condition or a target

func New

func New(rs ResourceConfig) (resource Resource, err error)

New returns a newly initialized Resource or an error

type ResourceConfig

type ResourceConfig struct {
	// dependson specifies which resources must be executed before the current one
	DependsOn []string `yaml:",omitempty"`
	// name specifies the resource name
	Name string `yaml:",omitempty"`
	// kind specifies the resource kind which defines accepted spec value
	Kind string `yaml:",omitempty" jsonschema:"required"`
	// transformers defines how the default input value need to be transformed
	Transformers transformer.Transformers `yaml:",omitempty"`
	// spec specifies parameters for a specific resource kind
	Spec interface{} `yaml:",omitempty"`
	// Deprecated field on version [1.17.0]
	Scm map[string]interface{} `yaml:",omitempty"`
	// scmid specifies the scm configuration key associated to the current resource
	SCMID string `yaml:",omitempty"` // SCMID references a uniq scm configuration
	// !deprecated, please use scmid
	DeprecatedSCMID string `yaml:"scmID,omitempty" jsonschema:"-"` // SCMID references a uniq scm configuration
	// !deprecated, please use dependson
	DeprecatedDependsOn []string `yaml:"depends_on,omitempty" jsonschema:"-"` // depends_on specifies which resources must be executed before the current one
}

Jump to

Keyboard shortcuts

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