entrypoint

package
v0.0.0-...-e00f16c Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSupportedTypes = map[EntrypointType]bool{
	EntrypointTypeCdk:            true,
	EntrypointTypeHclV1:          false,
	EntrypointTypeHclV2:          false,
	EntrypointTypeCloudformation: true,
	EntrypointTypeKubernetes:     true,
	EntrypointTypeKustomize:      true,
	EntrypointTypeTerraform:      true,
}

Functions

This section is empty.

Types

type Entrypoint

type Entrypoint struct {
	Name      string                 `json:"name"`
	Directory string                 `json:"directory"`
	Type      EntrypointType         `json:"type"`
	Context   map[string]interface{} `json:"context"`
}

Entrypoint represents a path in a repository which contains IaC resources which can be loaded by Sancire

func DiscoverEntrypoints

func DiscoverEntrypoints(directory string, specs []EntrypointFactory) ([]Entrypoint, error)

TODO: Make this more performant, add a flag to only check dir names, include a basedir prop to limit search context DiscoverEntrypoints walks a directory and returns a list of Entrypoints matching the supplied specs

type EntrypointAutomaticDiscovery

type EntrypointAutomaticDiscovery struct {
	SupportedTypes map[EntrypointType]bool
	Context        map[string]interface{}
}

func AutomaticDiscovery

func AutomaticDiscovery(ctx map[string]interface{}, types map[EntrypointType]bool) EntrypointAutomaticDiscovery

func (EntrypointAutomaticDiscovery) MakeEntrypoint

func (epds EntrypointAutomaticDiscovery) MakeEntrypoint(basedir, repoPath string, isFile bool) (*Entrypoint, error)

type EntrypointDiscoverySpec

type EntrypointDiscoverySpec struct {
	Type    EntrypointType         `json:"type"`
	Regex   regexp.Regexp          `json:"regex"`
	Files   bool                   `json:"files"`
	Context map[string]interface{} `json:"context"`
}

EntrypointDiscoverySpec represents a specification for discovering Entrypoint directories in a repository

func (EntrypointDiscoverySpec) MakeEntrypoint

func (epds EntrypointDiscoverySpec) MakeEntrypoint(basedir, repoPath string, isFile bool) (*Entrypoint, error)

MakeEntrypoint attepmpts to create an Entrypoint from a given path

type EntrypointFactory

type EntrypointFactory interface {
	MakeEntrypoint(basedir, realpath string, isFile bool) (*Entrypoint, error)
}

EntrypointFactory represents a factory for creating Entrypoints

type EntrypointType

type EntrypointType string

EntrypointType represents the tool which is used to manage the IaC resources in an Entrypoint

const (
	EntrypointTypeKubernetes     EntrypointType = "kubernetes"
	EntrypointTypeKustomize      EntrypointType = "kustomize"
	EntrypointTypeCloudformation EntrypointType = "cloudformation"
	EntrypointTypeCdk            EntrypointType = "cdk"
	EntrypointTypeTerraform      EntrypointType = "terraform"
	EntrypointTypeHclV1          EntrypointType = "hclv1"
	EntrypointTypeHclV2          EntrypointType = "hclv2"
)

Jump to

Keyboard shortcuts

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