pkg

package
v0.10.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigData added in v0.4.0

func GetConfigData(input *APIServer, appName string, showObjects string) ([]map[string]KustomizeResources, error)

func ReadConfiguration added in v0.1.0

func ReadConfiguration(repos []string, branches []string, hierarchy Config) []map[string]KustomizeResources

func Server added in v0.1.0

func Server(cmd *cobra.Command)

Types

type APIServer added in v0.1.0

type APIServer struct {
	Repos      []string
	Branches   []string
	ConfigFile string
}

func (*APIServer) GetApplicationHandler added in v0.5.0

func (input *APIServer) GetApplicationHandler() http.HandlerFunc

func (*APIServer) GetConfigHandler added in v0.4.0

func (input *APIServer) GetConfigHandler() http.HandlerFunc

func (*APIServer) GetSpaHandler added in v0.7.0

func (input *APIServer) GetSpaHandler(rootFs http.FileSystem) http.HandlerFunc

type Config

type Config struct {
	Hierarchy    []Item   `yaml:"hierarchy" json:"hierarchy"`
	Applications []string `yaml:"applications,omitempty" json:"applications,omitempty"`
}

func GetHierarchy added in v0.1.0

func GetHierarchy(configFile, applicationName string) (Config, error)

func (Config) GenerateJsPropertiesFile added in v0.8.0

func (config Config) GenerateJsPropertiesFile(resources []Resource) string

func (Config) GeneratePropertiesFile added in v0.1.0

func (config Config) GeneratePropertiesFile(resources []Resource) string

func (Config) GetProperties added in v0.1.0

func (config Config) GetProperties(resources []Resource) map[string]Property

func (Config) GetPropertiesMap added in v0.1.0

func (config Config) GetPropertiesMap(resources []Resource) map[string]string

func (Config) WalkHierarchy added in v0.1.0

func (config Config) WalkHierarchy(resources []Resource) []Resource

type Error added in v0.4.0

type Error struct {
	ErrorMessage string `yaml:"errorMessage" json:"errorMessage"`
}

type Item

type Item struct {
	Kind          string       `yaml:"kind" json:"kind"`
	Name          string       `yaml:"name" json:"name"`
	Namespace     string       `yaml:"namespace,omitempty" json:"namespace,omitempty"`
	Type          ResourceType `yaml:"type,omitempty" json:"type,omitempty"`
	Key           string       `yaml:"key,omitempty" json:"key,omitempty"`
	Index         int          `yaml:"index,omitempty" json:"index,omitempty"`
	HierarchyName string       `yaml:"hierarchyName,omitempty" json:"hierarchyName,omitempty"`
}

func (Item) FindIn added in v0.1.0

func (item Item) FindIn(resources []Resource) *Resource

func (Item) String added in v0.1.0

func (item Item) String() string

type KustomizeResources added in v0.1.0

type KustomizeResources struct {
	Resources      []string `yaml:"resources"`
	Bases          []string `yaml:"bases"`
	Environment    string
	SubEnvironment string
	FilePath       string
	FileDir        string
	Branch         string
	SubResource    bool
	ImportedBy     []string
	Global         bool
	Objects        []Resource
	Properties     map[string]string
}

type Properties added in v0.1.0

type Properties []Property

func (Properties) Len added in v0.1.0

func (p Properties) Len() int

func (Properties) Less added in v0.1.0

func (p Properties) Less(i, j int) bool

func (Properties) Swap added in v0.1.0

func (p Properties) Swap(i, j int)

type Property added in v0.1.0

type Property struct {
	Key, Value string
	Comment    string
	Resource   Resource
}

func (Property) String added in v0.1.0

func (p Property) String() string

type Resource

type Resource struct {
	// path is the relative path to the file containing the resource definition
	Path string
	// A configmap, secret or sealed secret
	Item *unstructured.Unstructured
	// A type of resource that resource holds either native or properties from file
	Hierarchy Item
}

func GetResources added in v0.1.0

func GetResources(buf []byte) ([]Resource, error)

func ReadResources added in v0.1.0

func ReadResources(input string) ([]Resource, error)

func (Resource) GeneratePropertesMapFromProperties added in v0.1.0

func (r Resource) GeneratePropertesMapFromProperties() map[string]string

func (Resource) GeneratePropertiesMapFromNative added in v0.1.0

func (r Resource) GeneratePropertiesMapFromNative() map[string]string

func (Resource) GetProperties added in v0.1.0

func (r Resource) GetProperties() []Property

func (Resource) GetPropertiesMap added in v0.1.0

func (r Resource) GetPropertiesMap() map[string]string

func (Resource) String added in v0.1.0

func (r Resource) String() string

type ResourceType added in v0.1.0

type ResourceType string
const (
	ResourceTypeNative     ResourceType = "native"
	ResourceTypeProperties ResourceType = "properties"
)

Jump to

Keyboard shortcuts

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