types

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValueTypeMap = map[string]Type{
	"INTEGER": IntegerType,
	"FLOAT":   FloatType,
	"BOOL":    BoolType,
	"ACL":     AclType,
	"BACKEND": BackendType,
	"IP":      IPType,
	"STRING":  StringType,
	"RTIME":   RTimeType,
	"TIME":    TimeType,
}

Functions

This section is empty.

Types

type Acl

type Acl struct {
	Decl   *ast.AclDeclaration
	IsUsed bool // mark this acl is accessed at least once
}

func (*Acl) String

func (a *Acl) String() string

func (*Acl) Token

func (a *Acl) Token() token.Token

func (*Acl) Type

func (a *Acl) Type() Type

type AclEntry added in v0.9.3

type AclEntry struct {
	Ip      string
	Negated string
	Subnet  *int64
	Comment string
}

type Backend

type Backend struct {
	BackendDecl  *ast.BackendDeclaration
	DirectorDecl *ast.DirectorDeclaration
	IsUsed       bool // mark this backend is accessed at least once
}

func (*Backend) String

func (b *Backend) String() string

func (*Backend) Token

func (b *Backend) Token() token.Token

func (*Backend) Type

func (b *Backend) Type() Type

type Bool

type Bool struct {
	Exp   *ast.Boolean
	Value bool
}

func (*Bool) String

func (b *Bool) String() string

func (*Bool) Token

func (b *Bool) Token() token.Token

func (*Bool) Type

func (b *Bool) Type() Type

type Director

type Director struct {
	Decl *ast.DirectorDeclaration
}

func (*Director) String

func (d *Director) String() string

func (*Director) Token

func (d *Director) Token() token.Token

func (*Director) Type

func (d *Director) Type() Type

type Error

type Error struct {
	Value error
}

func (*Error) String

func (e *Error) String() string

func (*Error) Token

func (e *Error) Token() token.Token

func (*Error) Type

func (e *Error) Type() Type

type Float

type Float struct {
	Exp   *ast.Float
	Value float64
}

func (*Float) String

func (f *Float) String() string

func (*Float) Token

func (f *Float) Token() token.Token

func (*Float) Type

func (f *Float) Type() Type

type Goto added in v0.9.3

type Goto struct {
	Decl   *ast.GotoStatement
	IsUsed bool // mark this goto is called at least once
}

func (*Goto) String added in v0.9.3

func (g *Goto) String() string

func (*Goto) Token added in v0.9.3

func (g *Goto) Token() token.Token

func (*Goto) Type added in v0.9.3

func (g *Goto) Type() Type

type ID

type ID struct {
	Exp   *ast.Ident
	Value string
}

func (*ID) String

func (i *ID) String() string

func (*ID) Token

func (i *ID) Token() token.Token

func (*ID) Type

func (i *ID) Type() Type

type IP

type IP struct {
	Exp   *ast.IP
	Value string
}

func (*IP) String

func (i *IP) String() string

func (*IP) Token

func (i *IP) Token() token.Token

func (*IP) Type

func (i *IP) Type() Type

type Integer

type Integer struct {
	Exp   *ast.Integer
	Value int64
}

func (*Integer) String

func (i *Integer) String() string

func (*Integer) Token

func (i *Integer) Token() token.Token

func (*Integer) Type

func (i *Integer) Type() Type

type Null

type Null struct {
}

func (*Null) String

func (n *Null) String() string

func (*Null) Token

func (n *Null) Token() token.Token

func (*Null) Type

func (n *Null) Type() Type

type Penaltybox added in v0.9.3

type Penaltybox struct {
	Decl   *ast.PenaltyboxDeclaration
	IsUsed bool // mark this penaltybox is called at least once
}

func (*Penaltybox) String added in v0.9.3

func (pb *Penaltybox) String() string

func (*Penaltybox) Token added in v0.9.3

func (pb *Penaltybox) Token() token.Token

func (*Penaltybox) Type added in v0.9.3

func (pb *Penaltybox) Type() Type

type RTime

type RTime struct {
	Exp   *ast.RTime
	Value time.Duration
}

func (*RTime) String

func (r *RTime) String() string

func (*RTime) Token

func (r *RTime) Token() token.Token

func (*RTime) Type

func (r *RTime) Type() Type

type Ratecounter added in v0.9.3

type Ratecounter struct {
	Decl   *ast.RatecounterDeclaration
	IsUsed bool // mark this ratecounter is called at least once
}

func (*Ratecounter) String added in v0.9.3

func (rc *Ratecounter) String() string

func (*Ratecounter) Token added in v0.9.3

func (rc *Ratecounter) Token() token.Token

func (*Ratecounter) Type added in v0.9.3

func (rc *Ratecounter) Type() Type

type RemoteAcl added in v0.9.3

type RemoteAcl struct {
	Name    string
	Entries []*AclEntry
}

type RemoteBackend added in v0.9.3

type RemoteBackend struct {
	Name    string
	Shield  *string
	Address *string
}

TODO(davinci26): We can unmarshall all the properties from the TF file and lint them to make sure they have sane values.

type RemoteDictionary added in v0.9.3

type RemoteDictionary struct {
	Name  string
	Items []*RemoteDictionaryItem
}

type RemoteDictionaryItem added in v0.9.3

type RemoteDictionaryItem struct {
	Key   string
	Value string
}

type RemoteVCL added in v0.9.3

type RemoteVCL struct {
	Name     string
	Type     string
	Content  string
	Priority int64
}

type String

type String struct {
	Exp   *ast.String
	Value string
}

func (*String) String

func (s *String) String() string

func (*String) Token

func (s *String) Token() token.Token

func (*String) Type

func (s *String) Type() Type

type Subroutine

type Subroutine struct {
	Decl   *ast.SubroutineDeclaration
	Body   *ast.BlockStatement
	IsUsed bool // mark this subroutine is called at least once
}

func (*Subroutine) String

func (s *Subroutine) String() string

func (*Subroutine) Token

func (s *Subroutine) Token() token.Token

func (*Subroutine) Type

func (s *Subroutine) Type() Type

type Table

type Table struct {
	Decl       *ast.TableDeclaration
	Name       string
	ValueType  Type
	Properties []*ast.TableProperty
	IsUsed     bool // mark this table is accessed at least once
}

func (*Table) String

func (t *Table) String() string

func (*Table) Token

func (t *Table) Token() token.Token

func (*Table) Type

func (t *Table) Type() Type

type Time

type Time struct {
	Exp   *ast.String
	Value time.Time
}

func (*Time) String

func (t *Time) String() string

func (*Time) Token

func (t *Time) Token() token.Token

func (*Time) Type

func (t *Time) Type() Type

type Type

type Type int
const (
	// https://developer.fastly.com/reference/vcl/types/
	NeverType       Type = 0x000000000000000
	AclType         Type = 0x000000000000001
	BackendType     Type = 0x000000000000010
	BoolType        Type = 0x000000000000100
	FloatType       Type = 0x000000000001000
	IDType          Type = 0x000000000010000
	IntegerType     Type = 0x000000000100000
	IPType          Type = 0x000000001000000
	RTimeType       Type = 0x000000010000000
	StringType      Type = 0x000000100000000
	TimeType        Type = 0x000001000000000
	NullType        Type = 0x000010000000000
	ErrorType       Type = 0x000100000000000
	SubroutineType  Type = 0x001000000000000
	TableType       Type = 0x010000000000000
	DirectorType    Type = 0x100000000000000
	PenaltyboxType  Type = 0x100000000000001
	RatecounterType Type = 0x100000000000010
	GotoType        Type = 0x100000000000100

	// StringListType is unusual VCL type, just alias for Array<String>.
	// This type is used for variadic arguments of builtin function like h2.disable_header_compression(string...)
	// Note that this type must not be used in VCL codes, only use for linting function arguments.
	StringListType Type = 0x100000000001000
	// ReqBackendType is a virtual type used to represent the special behavior of
	// the req.backend variable. Unlike typical backend variables, it can be cast
	// to a string.
	// Any backend is implicitly cast to ReqBackendType when set to req.backend.
	ReqBackendType Type = 0x100000000010000
)

func (Type) String

func (t Type) String() string

type VCLType

type VCLType interface {
	Type() Type
	Token() token.Token
	String() string
}

Jump to

Keyboard shortcuts

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