core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Identifiers = map[string]struct{}{

	"always": {},
	"never":  {},

	"aes128": {},
	"aes192": {},
	"aes256": {},

	"cbc": {},
	"ctr": {},

	"pkcs7": {},
	"nopad": {},

	"default": {},
	"sha256":  {},
	"sha384":  {},
	"sha512":  {},

	"standard":  {},
	"url":       {},
	"url_nopad": {},

	"req":    {},
	"bereq":  {},
	"obj":    {},
	"beresp": {},
	"resp":   {},
}

Fastly predefined identifier list. we listed as possible as found in Fastly document site, but perhaps there are more builtin identifiers.

Functions

This section is empty.

Types

type CoreTransformer

type CoreTransformer struct {
	Packages value.Packages
	// contains filtered or unexported fields
}

func NewCoreTransfromer

func NewCoreTransfromer(opts ...TransformOption) *CoreTransformer

func (*CoreTransformer) TemplateVariables

func (tf *CoreTransformer) TemplateVariables() map[string]any

func (*CoreTransformer) Transform

func (tf *CoreTransformer) Transform(rslv resolver.Resolver) ([]byte, error)

type CoreVariable

type CoreVariable struct {
	*v.VariablesImpl
}

func NewCoreVariables

func NewCoreVariables() *CoreVariable

func (*CoreVariable) Get

func (cv *CoreVariable) Get(name string) (*value.Value, error)

nolint:funlen,gocyclo

func (*CoreVariable) Set

func (cv *CoreVariable) Set(name string, val *value.Value) (*value.Value, error)

nolint:funlen,gocyclo

func (*CoreVariable) Unset

func (cv *CoreVariable) Unset(name string) (*value.Value, error)

type ErrTransform

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

func TransformError

func TransformError(t *token.Token, format string, args ...any) *ErrTransform

func (*ErrTransform) Error

func (e *ErrTransform) Error() string

type RegexMatchedGroup

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

func (*RegexMatchedGroup) Last

func (r *RegexMatchedGroup) Last() string

func (*RegexMatchedGroup) Pop

func (r *RegexMatchedGroup) Pop()

func (*RegexMatchedGroup) Push

func (r *RegexMatchedGroup) Push(v string)

type Spec

type Spec struct {
	Name          string
	ReturnType    value.VCLType
	Requires      []value.VCLType
	Optionals     []value.VCLType
	VariadicIndex int
}

type TransformOption

type TransformOption func(t *CoreTransformer)

func WithFastlyPlatform

func WithFastlyPlatform() TransformOption

func WithOutputPackage

func WithOutputPackage(v string) TransformOption

func WithRuntimeName

func WithRuntimeName(v string) TransformOption

func WithSnippets

func WithSnippets(snip *snippets.Snippets) TransformOption

func WithVariables

func WithVariables(v variable.Variables) TransformOption

type Transformer

type Transformer interface {
	Transform(resolver.Resolver) ([]byte, error)
}

Jump to

Keyboard shortcuts

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