value

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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const NIL = "nil"

Variables

View Source
var ErrorCheck = "if err != nil {\nreturn vintage.NONE, err\n}"

Functions

func DefaultValue

func DefaultValue(t VCLType) string

func GoTypeString

func GoTypeString(t VCLType) string

func Temporary

func Temporary() string

func UseFixedTemporalValue

func UseFixedTemporalValue()

Types

type Package

type Package struct {
	Alias string
}

type Packages

type Packages map[string]Package

func (Packages) Add

func (p Packages) Add(name, alias string)

func (Packages) Merge

func (p Packages) Merge(pkgs Packages)

func (Packages) Sorted

func (p Packages) Sorted() []string

type VCLType

type VCLType string
const (
	IDENT   VCLType = "IDENT"
	INTEGER VCLType = "INTEGER"
	FLOAT   VCLType = "FLOAT"
	STRING  VCLType = "STRING"
	BOOL    VCLType = "BOOL"
	IP      VCLType = "IP"
	RTIME   VCLType = "RTIME"
	TIME    VCLType = "TIME"
	BACKEND VCLType = "BACKEND"
	ACL     VCLType = "ACL"
	NULL    VCLType = "NULL"
)

type Value

type Value struct {
	Type         VCLType
	Code         string
	Prepare      string
	Dependencies Packages
	Comment      string
	Deprecated   bool
	Matches      string
}

func NewValue

func NewValue(t VCLType, code string, preps ...ValueOption) *Value

func (*Value) Conversion

func (v *Value) Conversion(expect VCLType) *Value

func (*Value) String

func (v *Value) String() string

type ValueOption

type ValueOption func(e *Value)

func Comment

func Comment(c string) ValueOption

func Dependency

func Dependency(pkg, alias string) ValueOption

func Deprecated

func Deprecated() ValueOption

func FromValue

func FromValue(v *Value) ValueOption

func Matches

func Matches(m string) ValueOption

func Prepare

func Prepare(preps ...string) ValueOption

Jump to

Keyboard shortcuts

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