Documentation ¶
Index ¶
Constants ¶
View Source
const ( IndentStyleSpace = "space" IndentStyleTab = "tab" CommentStyleNone = "none" CommentStyleSlash = "slash" CommentStyleSharp = "sharp" )
Formatting value constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Root configurations IncludePaths []string `cli:"I,include_path" yaml:"include_paths"` Help bool `cli:"h,help"` Version bool `cli:"V"` Remote bool `cli:"r,remote" yaml:"remote"` Json bool `cli:"json"` Request string `cli:"request"` // Remote options, only provided via environment variable FastlyServiceID string `env:"FASTLY_SERVICE_ID"` FastlyApiKey string `env:"FASTLY_API_KEY"` // CLI subcommands Commands Commands // Override Origin fetching URL OverrideBackends map[string]*OverrideBackend `yaml:"override_backends"` // Override resource limits OverrideMaxBackends int `cli:"max_backends" yaml:"max_backends"` OverrideMaxAcls int `cli:"mac_acls" yaml:"max_acls"` // Linter configuration Linter *LinterConfig `yaml:"linter"` // Simulator configuration Simulator *SimulatorConfig `yaml:"simulator"` // Testing configuration Testing *TestConfig `yaml:"testing"` // Console configuration Console *ConsoleConfig `yaml:"console"` // Format configuration Format *FormatConfig `yaml:"format"` }
type ConsoleConfig ¶ added in v1.6.0
type ConsoleConfig struct { // Initial scope string, for example, recv, pass, fetch, etc... Scope string `cli:"scope" default:"recv"` // Override Request configuration OverrideRequest *RequestConfig }
Console configuration
type EdgeDictionary ¶ added in v1.8.0
type FormatConfig ¶ added in v1.6.0
type FormatConfig struct { // CLI options Overwrite bool `cli:"w,write" default:"false"` // Formatter options IndentWidth int `yaml:"indent_width" default:"2"` TrailingCommentWidth int `yaml:"trailing_comment_width" default:"1"` IndentStyle string `yaml:"indent_style" default:"space"` LineWidth int `yaml:"line_width" default:"120"` ExplicitStringConat bool `yaml:"explicit_string_concat" default:"false"` SortDeclarationProperty bool `yaml:"sort_declaration_property" default:"false"` AlignDeclarationProperty bool `yaml:"align_declaration_property" default:"false"` ElseIf bool `yaml:"else_if" default:"false"` AlwaysNextLineElseIf bool `yaml:"always_next_line_else_if" default:"false"` ReturnStatementParenthesis bool `yaml:"return_statement_parenthesis" default:"true"` SortDeclaration bool `yaml:"sort_declaration" default:"false"` AlignTrailingComment bool `yaml:"align_trailing_comment" default:"false"` CommentStyle string `yaml:"comment_style" default:"none"` ShouldUseUnset bool `yaml:"should_use_unset" default:"false"` IndentCaseLabels bool `yaml:"indent_case_labels" default:"false"` }
Format configuration
type LinterConfig ¶ added in v1.0.0
type LinterConfig struct { VerboseLevel string `yaml:"verbose"` VerboseWarning bool `cli:"v"` VerboseInfo bool `cli:"vv"` Rules map[string]string `yaml:"rules"` EnforceSubroutineScopes map[string][]string `yaml:"enforce_subroutine_scopes"` IgnoreSubroutines []string `yaml:"ignore_subroutines"` IsGenerated bool `cli:"generated"` }
Linter configuration
type OverrideBackend ¶ added in v1.0.0
type RequestConfig ¶ added in v1.0.0
type RequestConfig struct { RemoteIP string `yaml:"remote_ip" json:"remote_ip"` RequestHeaders map[string]string `yaml:"headers" json:"headers"` Path string `yaml:"path" json:"path"` UserAgent string `yaml:"user_agent" json:"user_agent"` }
func LoadRequestConfig ¶ added in v1.0.0
func LoadRequestConfig(path string) (*RequestConfig, error)
func (*RequestConfig) SetRequest ¶ added in v1.0.0
func (r *RequestConfig) SetRequest(req *http.Request)
type SimulatorConfig ¶ added in v1.0.0
type SimulatorConfig struct { Port int `cli:"p,port" yaml:"port" default:"3124"` IsDebug bool `cli:"debug"` // Enable only in CLI option IsProxyResponse bool `cli:"proxy"` // Enable only in CLI option IncludePaths []string // Copy from root field // HTTPS related configuration. If both fields are spcified, simulator will serve with HTTPS KeyFile string `cli:"key" yaml:"key_file"` CertFile string `cli:"cert" yaml:"cert_file"` // Inject Edge Dictionary items OverrideEdgeDictionaries map[string]EdgeDictionary `yaml:"edge_dictionary"` // Override Request configuration OverrideRequest *RequestConfig // Inject values that the simulator returns tentative value InjectValues map[string]any `yaml:"values"` }
Simulator configuration
type TestConfig ¶ added in v1.0.0
type TestConfig struct { Timeout int `cli:"t,timeout" yaml:"timeout"` Filter string `cli:"f,filter" default:"*.test.vcl"` IncludePaths []string // Copy from root field OverrideHost string `yaml:"host"` Watch bool `cli:"watch"` // Enable only in CLI option // Override Request configuration OverrideRequest *RequestConfig // Override tentative variable values CLIOverrideVariables []string `cli:"o,override"` // from CLI YamlOverrideVariables map[string]any `yaml:"overrides"` // from .falco.yaml }
Testing configuration
Click to show internal directories.
Click to hide internal directories.