Documentation ¶
Index ¶
- Variables
- func ConvertToYaml(root Node) interface{}
- func GetEncodedSecrets(scriptName string, destinationDir string, name string, descriptorPath string) (map[string]string, error)
- func ToMap(node Node) interface{}
- type Apply
- type ConfigImporter
- type ConfigSource
- type Configuration
- type DefaultVisitor
- func (DefaultVisitor) AfterList(node *ListNode)
- func (DefaultVisitor) AfterListItem(node *ListNode, item Node, index int)
- func (DefaultVisitor) AfterMap(node *MapNode)
- func (DefaultVisitor) AfterMapItem(node *MapNode, key string, index int)
- func (DefaultVisitor) BeforeList(node *ListNode)
- func (DefaultVisitor) BeforeListItem(node *ListNode, item Node, index int)
- func (DefaultVisitor) BeforeMap(node *MapNode)
- func (DefaultVisitor) BeforeMapItem(node *MapNode, key string, index int)
- func (DefaultVisitor) OnKey(*KeyNode)
- type Downloader
- type EnvSource
- type FixPath
- func (visitor *FixPath) AfterList(node *ListNode)
- func (visitor *FixPath) AfterListItem(node *ListNode, item Node, index int)
- func (visitor *FixPath) AfterMap(node *MapNode)
- func (visitor *FixPath) AfterMapItem(node *MapNode, key string, index int)
- func (visitor *FixPath) BeforeList(node *ListNode)
- func (visitor *FixPath) BeforeListItem(node *ListNode, item Node, index int)
- func (visitor *FixPath) BeforeMap(node *MapNode)
- func (visitor *FixPath) BeforeMapItem(node *MapNode, key string, index int)
- func (visitor *FixPath) OnKey(node *KeyNode)
- type FlekszibleResource
- type Generator
- type Get
- type GetAll
- type GetAllResult
- type GetKeys
- type GetKeysResult
- type GetStrings
- type GetStringsResults
- type ImportConfiguration
- type KeyNode
- type Kubeconfig
- type ListNode
- type LocalSource
- type MapNode
- func (node *MapNode) Accept(v Visitor)
- func (node *MapNode) CreateList(key string) *ListNode
- func (node *MapNode) CreateMap(key string) *MapNode
- func (node MapNode) Get(s string) Node
- func (node *MapNode) GetPath() Path
- func (node *MapNode) GetStringValue(s string) string
- func (node MapNode) HasKey(s string) bool
- func (node *MapNode) Keys() []string
- func (node *MapNode) Len() int
- func (mapNode *MapNode) MarshalJSON() ([]byte, error)
- func (node *MapNode) Put(key string, value Node)
- func (node *MapNode) PutValue(key string, value interface{})
- func (node *MapNode) Remove(key string)
- func (m *MapNode) ToMap() map[string]interface{}
- func (node *MapNode) ToString() (string, error)
- type Node
- type NodeDownloader
- type OutputGenerator
- type Path
- func (path Path) Equal(other Path) bool
- func (path Path) Extend(segment string) Path
- func (path Path) IsEmpty() bool
- func (path Path) Last() string
- func (path Path) Length() int
- func (this Path) Match(that Path) bool
- func (this Path) MatchLimited(that Path) (bool, string)
- func (path Path) MatchSegments(segments ...string) bool
- func (path Path) Parent() Path
- func (path Path) Segment(i int) string
- func (path Path) ToString() string
- func (path *Path) UnmarshalYAML(unmarshal func(interface{}) error) error
- type PrintVisitor
- type ReSet
- type RemoteSource
- type Resource
- func GenerateSecret(destinationDir string, name string, secrets map[string]string) (*Resource, error)
- func LoadResourceFromByte(data []byte) ([]*Resource, error)
- func LoadResourceFromFile(dir string, file string) ([]*Resource, error)
- func LoadResourceFromFileInfo(dir string, file os.FileInfo) ([]*Resource, error)
- func NewResource() Resource
- func ReadResourcesFromDir(dir string) []*Resource
- type SecretGenerator
- type SecretGetConfig
- type SecretImporter
- type Set
- type SmartGetAll
- type Source
- type SourceCacheManager
- type UpdateMode
- type Visitor
- type Yamlize
Constants ¶
This section is empty.
Variables ¶
View Source
var Generators = make([]Generator, 0)
Functions ¶
func ConvertToYaml ¶
func ConvertToYaml(root Node) interface{}
ConvertToYaml converts internal node tree to YAML.
func GetEncodedSecrets ¶
Types ¶
type Apply ¶
type Apply struct { DefaultVisitor Path Path Function func(interface{}) interface{} }
type ConfigImporter ¶
type ConfigImporter struct { }
func (*ConfigImporter) Generate ¶
func (*ConfigImporter) Generate(sourceDir string, destinationDir string) ([]*Resource, error)
func (*ConfigImporter) IsManagedDir ¶
func (*ConfigImporter) IsManagedDir(dir string) bool
type ConfigSource ¶
type Configuration ¶
type Configuration struct { Name string `yaml:",omitempty"` Description string `yaml:",omitempty"` Source []ConfigSource `yaml:",omitempty"` Import []ImportConfiguration `yaml:",omitempty"` Transformations []yaml.MapSlice `yaml:",omitempty"` ResourcesDir string `yaml:"resources,omitempty"` Standalone bool `yaml:"-"` Header string `yaml:"header"` }
func ReadConfiguration ¶
func ReadConfiguration(dir string) (Configuration, string, error)
ReadConfiguration read configuration from flekszible.yaml or Flekszible file.
type DefaultVisitor ¶
type DefaultVisitor struct{}
func (DefaultVisitor) AfterList ¶
func (DefaultVisitor) AfterList(node *ListNode)
func (DefaultVisitor) AfterListItem ¶
func (DefaultVisitor) AfterListItem(node *ListNode, item Node, index int)
func (DefaultVisitor) AfterMap ¶
func (DefaultVisitor) AfterMap(node *MapNode)
func (DefaultVisitor) AfterMapItem ¶
func (DefaultVisitor) AfterMapItem(node *MapNode, key string, index int)
func (DefaultVisitor) BeforeList ¶
func (DefaultVisitor) BeforeList(node *ListNode)
func (DefaultVisitor) BeforeListItem ¶
func (DefaultVisitor) BeforeListItem(node *ListNode, item Node, index int)
func (DefaultVisitor) BeforeMap ¶
func (DefaultVisitor) BeforeMap(node *MapNode)
func (DefaultVisitor) BeforeMapItem ¶
func (DefaultVisitor) BeforeMapItem(node *MapNode, key string, index int)
func (DefaultVisitor) OnKey ¶
func (DefaultVisitor) OnKey(*KeyNode)
type Downloader ¶
var DownloaderPlugin Downloader = NodeDownloader{}
type EnvSource ¶
type EnvSource struct {
Dir string
}
type FixPath ¶
type FixPath struct { DefaultVisitor CurrentPath Path }
func (*FixPath) AfterListItem ¶
func (*FixPath) AfterMapItem ¶
func (*FixPath) BeforeList ¶
func (*FixPath) BeforeListItem ¶
func (*FixPath) BeforeMapItem ¶
type FlekszibleResource ¶
type FlekszibleResource struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata map[string]interface{} `yaml:"metadata"` Spec Configuration `yaml:"spec"` }
type Get ¶
type Get struct { DefaultVisitor Path Path ReturnValue Node Found bool }
func (*Get) BeforeList ¶
func (*Get) ValueAsString ¶
type GetAll ¶
type GetAll struct { DefaultVisitor Path Path Result []GetAllResult }
func (*GetAll) BeforeList ¶
type GetAllResult ¶
type GetKeys ¶
type GetKeys struct { DefaultVisitor Result []GetAllResult }
type GetKeysResult ¶
type GetStrings ¶
type GetStrings struct { DefaultVisitor Pattern string Result []GetStringsResults }
func (*GetStrings) OnKey ¶
func (visitor *GetStrings) OnKey(node *KeyNode)
type GetStringsResults ¶
type GetStringsResults struct {
Value *KeyNode
}
type ImportConfiguration ¶
type KeyNode ¶
type KeyNode struct { Value interface{} Path Path }
----------------- KEY NODE --------------
func NewKeyNode ¶
func (*KeyNode) MarshalJSON ¶
type Kubeconfig ¶
type Kubeconfig struct {
Path string
}
func CreateKubeConfig ¶
func CreateKubeConfig() Kubeconfig
func CreateKubeConfigFromFile ¶
func CreateKubeConfigFromFile(path string) Kubeconfig
func (*Kubeconfig) ReadCurrentNamespace ¶
func (config *Kubeconfig) ReadCurrentNamespace() (string, error)
type ListNode ¶
----------------- LIST NODE --------------
func NewListNode ¶
func (*ListNode) MarshalJSON ¶
type LocalSource ¶
type LocalSource struct {
Dir string
}
func (*LocalSource) GetPath ¶
func (source *LocalSource) GetPath(manager *SourceCacheManager) (string, error)
func (*LocalSource) ToString ¶
func (source *LocalSource) ToString() string
type MapNode ¶
type MapNode struct { Path Path // contains filtered or unexported fields }
----------------- MAP NODE --------------
func NewMapNode ¶
func ReadManifestFile ¶
func ReadManifestString ¶
func (*MapNode) CreateList ¶
func (*MapNode) GetStringValue ¶
func (*MapNode) MarshalJSON ¶
type Node ¶
func ConvertToNode ¶
Converts raw Yaml structure to file to internal node tree
func NodeFromPathValue ¶
type NodeDownloader ¶
type NodeDownloader struct { }
type OutputGenerator ¶
type OutputGenerator struct { }
func (*OutputGenerator) Generate ¶
func (*OutputGenerator) Generate(sourceDir string, destinationDir string) ([]*Resource, error)
func (*OutputGenerator) IsManagedDir ¶
func (*OutputGenerator) IsManagedDir(dir string) bool
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func (Path) MatchLimited ¶
MatchLimited if that is a shorter path, but all the elements are matched
func (Path) MatchSegments ¶
func (*Path) UnmarshalYAML ¶
type PrintVisitor ¶
type PrintVisitor struct {
DefaultVisitor
}
func (PrintVisitor) BeforeList ¶
func (PrintVisitor) BeforeList(node *ListNode)
func (PrintVisitor) BeforeMap ¶
func (PrintVisitor) BeforeMap(node *MapNode)
func (PrintVisitor) OnKey ¶
func (PrintVisitor) OnKey(node *KeyNode)
type ReSet ¶
type ReSet struct { DefaultVisitor Path Path NewValue interface{} }
type RemoteSource ¶
func (*RemoteSource) EnsureDownloaded ¶
func (source *RemoteSource) EnsureDownloaded(manager *SourceCacheManager) error
func (*RemoteSource) GetPath ¶
func (source *RemoteSource) GetPath(manager *SourceCacheManager) (string, error)
func (*RemoteSource) ToString ¶
func (source *RemoteSource) ToString() string
type Resource ¶
type Resource struct { Path string Filename string Content *MapNode Destination string DestinationFileName string Metadata map[string]string }
func GenerateSecret ¶
func LoadResourceFromByte ¶
func LoadResourceFromFile ¶
Load k8s resources from one yaml file
func NewResource ¶
func NewResource() Resource
func ReadResourcesFromDir ¶
read all the resources from a directory
type SecretGenerator ¶
type SecretGenerator struct { }
func (*SecretGenerator) Generate ¶
func (kt *SecretGenerator) Generate(sourceDir string, destinationDir string) ([]*Resource, error)
func (*SecretGenerator) IsManagedDir ¶
func (*SecretGenerator) IsManagedDir(dir string) bool
type SecretGetConfig ¶
type SecretGetConfig struct {
Script string
}
func ReadConfig ¶
func ReadConfig(file string) (SecretGetConfig, error)
type SecretImporter ¶
type SecretImporter struct { }
func (*SecretImporter) Generate ¶
func (*SecretImporter) Generate(sourceDir string, destinationDir string) ([]*Resource, error)
func (*SecretImporter) IsManagedDir ¶
func (*SecretImporter) IsManagedDir(dir string) bool
type Set ¶
type Set struct { DefaultVisitor Path Path NewValue interface{} }
type SmartGetAll ¶
type SmartGetAll struct { DefaultVisitor Path Path Result []GetAllResult }
func (*SmartGetAll) BeforeList ¶
func (visitor *SmartGetAll) BeforeList(node *ListNode)
func (*SmartGetAll) BeforeMap ¶
func (visitor *SmartGetAll) BeforeMap(node *MapNode)
func (*SmartGetAll) OnKey ¶
func (visitor *SmartGetAll) OnKey(node *KeyNode)
type Source ¶
type Source interface { GetPath(manager *SourceCacheManager) (string, error) ToString() string }
func LocalSourcesFromEnv ¶
func LocalSourcesFromEnv() []Source
type SourceCacheManager ¶
type SourceCacheManager struct { RootPath string UpdateMode UpdateMode // contains filtered or unexported fields }
func NewSourceCacheManager ¶
func NewSourceCacheManager(root string) SourceCacheManager
func (*SourceCacheManager) DoOnce ¶
func (manager *SourceCacheManager) DoOnce(cacheKey string, task func() error) error
func (*SourceCacheManager) GetCacheDir ¶
func (manager *SourceCacheManager) GetCacheDir(id string) string
type UpdateMode ¶
type UpdateMode string
const ( Always UpdateMode = "always" Never UpdateMode = "never" Init UpdateMode = "init" )
type Visitor ¶
type Visitor interface { OnKey(*KeyNode) BeforeMap(node *MapNode) AfterMap(node *MapNode) BeforeMapItem(node *MapNode, key string, index int) AfterMapItem(node *MapNode, key string, index int) BeforeList(node *ListNode) AfterList(node *ListNode) BeforeListItem(node *ListNode, item Node, index int) AfterListItem(node *ListNode, item Node, index int) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.