iac

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIACType

func IsIACType(t string) bool

func RegisterValidator

func RegisterValidator(validator Validator)

Types

type DiscoverOption

type DiscoverOption func(*discoverOption)

DiscoverOption specifies how to find and validate iacs.

func WithIACLimitSize

func WithIACLimitSize(limit int64) DiscoverOption

func WithIACType

func WithIACType(iacType IACType) DiscoverOption

type DockerComposeValidator

type DockerComposeValidator struct {
}

func (*DockerComposeValidator) ID

func (*DockerComposeValidator) Validate

func (d *DockerComposeValidator) Validate(path string, info fs.FileInfo) bool

type DockerfileValidator

type DockerfileValidator struct{}

func (*DockerfileValidator) ID

func (v *DockerfileValidator) ID() IACType

func (*DockerfileValidator) Validate

func (v *DockerfileValidator) Validate(path string, info fs.FileInfo) bool

type IAC

type IAC struct {
	Path string
	Type IACType
}

func DiscoverIACs

func DiscoverIACs(root string, opts ...DiscoverOption) ([]IAC, error)

type IACType

type IACType string
const (
	Unknown       IACType = "unknown"
	Dockerfile    IACType = "dockerfile"
	DockerCompose IACType = "docker-compose"
	Kubernetes    IACType = "kubernetes"
)

func DiscoverType

func DiscoverType(path string, opts ...DiscoverOption) (IACType, error)

func (IACType) String

func (t IACType) String() string

type KubernetesValidator

type KubernetesValidator struct{}

func (*KubernetesValidator) ID

func (k *KubernetesValidator) ID() IACType

func (*KubernetesValidator) Validate

func (k *KubernetesValidator) Validate(path string, info fs.FileInfo) bool

type Validator

type Validator interface {
	ID() IACType
	Validate(path string, info fs.FileInfo) bool
}

Jump to

Keyboard shortcuts

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