resolver

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyMain = errors.New("Input file is empty")
)

Functions

This section is empty.

Types

type EmptyResolver

type EmptyResolver struct{}

func (*EmptyResolver) MainVCL

func (e *EmptyResolver) MainVCL() (*VCL, error)

func (*EmptyResolver) Name

func (e *EmptyResolver) Name() string

func (*EmptyResolver) Resolve

func (e *EmptyResolver) Resolve(stmt *ast.IncludeStatement) (*VCL, error)

type FileResolver

type FileResolver struct {
	// contains filtered or unexported fields
}

FileResolver is filesystem resolver, basically used for built vcl files

func (*FileResolver) MainVCL

func (f *FileResolver) MainVCL() (*VCL, error)

func (*FileResolver) Name

func (f *FileResolver) Name() string

func (*FileResolver) Resolve

func (f *FileResolver) Resolve(stmt *ast.IncludeStatement) (*VCL, error)

type Resolver

type Resolver interface {
	MainVCL() (*VCL, error)
	Resolve(stmt *ast.IncludeStatement) (*VCL, error)
	Name() string
}

Resolver is an interface to fetch VCL source and dependencies from various sources e.g. file or JSON (terraform planned data)

func NewFileResolvers

func NewFileResolvers(main string, includePaths []string) ([]Resolver, error)

func NewTerraformResolver

func NewTerraformResolver(services []*terraform.FastlyService) []Resolver

type StaticResolver added in v1.0.0

type StaticResolver struct {
	// contains filtered or unexported fields
}

func NewStaticResolver added in v1.0.0

func NewStaticResolver(name, content string) *StaticResolver

func (*StaticResolver) MainVCL added in v1.0.0

func (s *StaticResolver) MainVCL() (*VCL, error)

func (*StaticResolver) Name added in v1.0.0

func (s *StaticResolver) Name() string

func (*StaticResolver) Resolve added in v1.0.0

func (s *StaticResolver) Resolve(stmt *ast.IncludeStatement) (*VCL, error)

type TerraformResolver

type TerraformResolver struct {
	Modules     []*VCL
	Main        *VCL
	ServiceName string
}

TerraformResolver is in memory resolver, read and factory vcl data from terraform planned JSON input

func (*TerraformResolver) MainVCL

func (s *TerraformResolver) MainVCL() (*VCL, error)

func (*TerraformResolver) Name

func (s *TerraformResolver) Name() string

func (*TerraformResolver) Resolve

func (s *TerraformResolver) Resolve(stmt *ast.IncludeStatement) (*VCL, error)

type VCL

type VCL struct {
	Name string
	Data string
}

Jump to

Keyboard shortcuts

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