config

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Version1 = "1"
	Version2 = "2"
)

Scaffolding versions

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Version is the project version, defaults to "1" (backwards compatibility)
	Version string `json:"version,omitempty"`

	// Domain is the domain associated with the project and used for API groups
	Domain string `json:"domain,omitempty"`

	// Repo is the go package name of the project root
	Repo string `json:"repo,omitempty"`

	// Resources tracks scaffolded resources in the project
	// This info is tracked only in project with version 2
	Resources []GVK `json:"resources,omitempty"`

	// Multigroup tracks if the project has more than one group
	MultiGroup bool `json:"multigroup,omitempty"`
}

Config is the unmarshalled representation of the configuration file

func (*Config) AddResource

func (config *Config) AddResource(gvk GVK) bool

AddResource appends the provided resource to the tracked ones It returns if the configuration was modified NOTE: in v1 resources are not tracked, so we return false

func (Config) HasGroup

func (config Config) HasGroup(group string) bool

HasGroup returns true if group is already tracked

func (Config) HasResource

func (config Config) HasResource(target GVK) bool

HasResource returns true if API resource is already tracked

func (Config) IsV1

func (config Config) IsV1() bool

IsV1 returns true if it is a v1 project

func (Config) IsV2

func (config Config) IsV2() bool

IsV2 returns true if it is a v2 project

type GVK

type GVK struct {
	Group   string `json:"group,omitempty"`
	Version string `json:"version,omitempty"`
	Kind    string `json:"kind,omitempty"`
}

GVK contains information about scaffolded resources

Jump to

Keyboard shortcuts

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