resolver

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 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) IncludePaths added in v1.10.0

func (e *EmptyResolver) IncludePaths() []string

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) IncludePaths added in v1.10.0

func (f *FileResolver) IncludePaths() []string

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 GlobResolver added in v1.6.0

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

GlobResolver is glob pattern factory resolver, will be used for formatter Note that GlobResolver does not want to include paths because formatter does not need to resolve included files

func (*GlobResolver) IncludePaths added in v1.10.0

func (g *GlobResolver) IncludePaths() []string

func (*GlobResolver) MainVCL added in v1.6.0

func (g *GlobResolver) MainVCL() (*VCL, error)

func (*GlobResolver) Name added in v1.6.0

func (g *GlobResolver) Name() string

func (*GlobResolver) Resolve added in v1.6.0

func (g *GlobResolver) Resolve(sttmt *ast.IncludeStatement) (*VCL, error)

type Resolver

type Resolver interface {
	MainVCL() (*VCL, error)
	Resolve(stmt *ast.IncludeStatement) (*VCL, error)
	Name() string
	IncludePaths() []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 NewGlobResolver added in v1.6.0

func NewGlobResolver(patterns ...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) IncludePaths added in v1.10.0

func (s *StaticResolver) IncludePaths() []string

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) IncludePaths added in v1.10.0

func (s *TerraformResolver) IncludePaths() []string

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