Documentation ¶
Index ¶
- Variables
- func DeepCopy(in any) (any, error)
- func GetBlockTypeNames() []string
- func ListBlocks(ctx context.Context, s store.Storer[Block], opts ...ListBlockOptions) map[string]Block
- func NewBlock(ctx context.Context, blockType kformv1alpha1.BlockType, blockName string, ...) (*block, error)
- type Block
- type BlockInitializer
- type BlockProcessor
- type Context
- type ContextAPI
- type CtxKey
- type Initializer
- type ListBlockOptions
- type Package
- func (r *Package) AddDependencies(ctx context.Context)
- func (r *Package) GenerateDAG(ctx context.Context, provider bool, usedProviderConfigs sets.Set[string]) error
- func (r *Package) GetBlockdata(ctx context.Context) map[string]data.BlockData
- func (r *Package) ListBlocks(ctx context.Context) []string
- func (r *Package) ListPkgDependencies(ctx context.Context) sets.Set[string]
- func (r *Package) ListProviderConfigs(ctx context.Context) map[string]Block
- func (r *Package) ListProviderRequirements(ctx context.Context) map[string]kformv1alpha1.Provider
- func (r *Package) ListProvidersFromResources(ctx context.Context) sets.Set[string]
- func (r *Package) ListRawProvidersFromResources(ctx context.Context) sets.Set[string]
- func (r *Package) ListResources(ctx context.Context) sets.Set[Block]
- func (r *Package) ResolveDAGDependencies(ctx context.Context)
- func (r *Package) ResolveResource2ProviderConfig(ctx context.Context)
- func (r *Package) ValidateMixinProviderConfigs(ctx context.Context)
- type PackageKind
- type Provider
- type VertexContext
Constants ¶
This section is empty.
Variables ¶
View Source
var BlockTypes = map[kformv1alpha1.BlockType]BlockInitializer{ kformv1alpha1.BlockType_BACKEND: newBackend, kformv1alpha1.BlockTYPE_PROVIDER: newProvider, kformv1alpha1.BlockTYPE_PACKAGE: newMixin, kformv1alpha1.BlockTYPE_INPUT: newInput, kformv1alpha1.BlockTYPE_OUTPUT: newOutput, kformv1alpha1.BlockTYPE_LOCAL: newLocal, kformv1alpha1.BlockTYPE_RESOURCE: newResource, kformv1alpha1.BlockTYPE_DATA: newResource, kformv1alpha1.BlockTYPE_LIST: newResource, }
View Source
var ResourceBlockTypes = []string{ kformv1alpha1.BlockTYPE_RESOURCE.String(), kformv1alpha1.BlockTYPE_DATA.String(), kformv1alpha1.BlockTYPE_LIST.String(), }
Functions ¶
func GetBlockTypeNames ¶
func GetBlockTypeNames() []string
func ListBlocks ¶
Types ¶
type Block ¶
type Block interface { GetFileName() string GetIndex() string GetPackageName() string GetBlockName() string GetBlockType() kformv1alpha1.BlockType GetContext(n string) string HasForEach() bool HasCount() bool GetSource() string GetProvider() string GetInputParameters() map[string]any GetProviders() map[string]string // only relevant for mixin // Dependencies GetDependencies() sets.Set[string] GetPkgDependencies() sets.Set[string] UpdateDependencies(sets.Set[string]) UpdatePkgDependencies(sets.Set[string]) //GetKubeObject() *fn.KubeObject GetAttributes() *kformv1alpha1.Attributes GetData() data.BlockData // contains filtered or unexported methods }
type BlockInitializer ¶
type BlockInitializer func(ctx context.Context) BlockProcessor
type BlockProcessor ¶
func InitializeBlock ¶
func InitializeBlock(ctx context.Context, blockType kformv1alpha1.BlockType) (BlockProcessor, error)
type ContextAPI ¶
type CtxKey ¶
type CtxKey string
const ( CtxKeyRecorder CtxKey = "recorder" CtxKeyPackage CtxKey = "package" // store the Package CtxKeyPackageName CtxKey = "packageName" CtxKeyPackageKind CtxKey = "packageKind" CtxKeyFileName CtxKey = "fileName" CtxKeyIndex CtxKey = "index" CtxKeyBlockType CtxKey = "blockType" CtxKeyResourceID CtxKey = "resourceID" CtxKeyResourceType CtxKey = "resourcetype" CtxKeyYamlRNODE CtxKey = "yamlRNODE" // stores the kubeObject )
type Initializer ¶
func ProviderInitializer ¶ added in v0.0.3
func ProviderInitializer(execPath string) Initializer
ProviderInitializer produces a provider factory that runs up the executable file in the given path and uses go-plugin to implement Provider Interface against it.
type ListBlockOptions ¶
type Package ¶
type Package struct { Name string Kind PackageKind SourceDir string Backend Block ProviderRequirements store.Storer[kformv1alpha1.Provider] ProviderConfigs store.Storer[Block] Blocks store.Storer[Block] DAG dag.DAG[*VertexContext] ProviderDAG dag.DAG[*VertexContext] // contains filtered or unexported fields }
func NewPackage ¶
func NewPackage(name string, kind PackageKind, recorder recorder.Recorder[diag.Diagnostic]) *Package
func (*Package) AddDependencies ¶
func (*Package) GenerateDAG ¶
func (*Package) GetBlockdata ¶
func (*Package) ListPkgDependencies ¶
func (*Package) ListProviderConfigs ¶
func (*Package) ListProviderRequirements ¶
func (*Package) ListProvidersFromResources ¶ added in v0.0.3
ListProvidersFromResources lists all providers resource identified this includes direct provider mappings as well as aliases
func (*Package) ListRawProvidersFromResources ¶ added in v0.0.3
ListRawProvidersFromResources lists all providers resource identified this includes only the main providers, no aliases
func (*Package) ListResources ¶ added in v0.0.3
func (*Package) ResolveDAGDependencies ¶
func (*Package) ResolveResource2ProviderConfig ¶
func (*Package) ValidateMixinProviderConfigs ¶
type PackageKind ¶
type PackageKind int
const ( PackageKind_ROOT PackageKind = iota PackageKind_MIXIN )
func (PackageKind) String ¶
func (d PackageKind) String() string
type Provider ¶
type VertexContext ¶
type VertexContext struct { // FileName and PackageName provide context in which this vertex is handled FileName string `json:"fileName"` Index string `json:"index"` PackageName string `json:"packageName"` // BlockType determines which function we need to execute BlockType kformv1alpha1.BlockType `json:"blockType"` // BlockName has syntx <namespace>.<name> BlockName string `json:"blockName"` // provides the contextual data Data data.BlockData Attributes *kformv1alpha1.Attributes Dependencies sets.Set[string] PkgDependencies sets.Set[string] // only relevant for blocktype resource, data and list //Provider string // only relevant for blocktype package/mixin // can be either a regular DAG or a provider DAG DAG dag.DAG[*VertexContext] }
func (*VertexContext) AddDAG ¶
func (r *VertexContext) AddDAG(d dag.DAG[*VertexContext])
func (*VertexContext) GetBlockDependencies ¶
func (r *VertexContext) GetBlockDependencies() sets.Set[string]
func (*VertexContext) GetDependencies ¶
func (r *VertexContext) GetDependencies() sets.Set[string]
func (*VertexContext) String ¶
func (r *VertexContext) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.