Documentation ¶
Index ¶
- Constants
- Variables
- type CustomLinterCall
- type DirectorProps
- type FatalError
- type LintError
- func AccessDenied(m *ast.Meta, name, scope string) *LintError
- func CustomLinterCommandFailed(message string, m *ast.Meta) *LintError
- func CustomLinterCommandNotFound(name string, m *ast.Meta) *LintError
- func DeprecatedVariable(name string, m *ast.Meta) *LintError
- func Duplicated(m *ast.Meta, name, ident string) *LintError
- func DuplicatedUseForGotoDestination(m *ast.Meta, name string) *LintError
- func ErrorCodeRange(m *ast.Meta, code int64) *LintError
- func ForbiddenBackwardJump(gs *ast.GotoStatement) *LintError
- func FromPluginError(pe *plugin.Error, m *ast.Meta) *LintError
- func FunctionArgumentMismatch(m *ast.Meta, name string, expect, actual int) *LintError
- func FunctionArgumentTypeMismatch(m *ast.Meta, name string, num int, expect, actual types.Type) *LintError
- func ImplicitTypeConversion(m *ast.Meta, from, to types.Type) *LintError
- func InvalidName(m *ast.Meta, name, ident string) *LintError
- func InvalidOperation(m *ast.Meta, name, operation string) *LintError
- func InvalidOperator(m *ast.Meta, op string, left types.Type) *LintError
- func InvalidReturnState(m *ast.Meta, scope, state string, expects ...string) *LintError
- func InvalidStringConcatenation(m *ast.Meta, ts string) *LintError
- func InvalidType(m *ast.Meta, name string, expect, actual types.Type) *LintError
- func InvalidTypeComparison(m *ast.Meta, left, right types.Type) *LintError
- func InvalidTypeConversion(m *ast.Meta, vclType string) *LintError
- func InvalidTypeExpression(m *ast.Meta, actual types.Type, expects ...types.Type) *LintError
- func InvalidTypeOperator(m *ast.Meta, op string, left, right types.Type) *LintError
- func InvalidValue(m *ast.Meta, tt, val string) *LintError
- func NonEmptyPenaltyboxBlock(m *ast.Meta, name string) *LintError
- func NonEmptyRatecounterBlock(m *ast.Meta, name string) *LintError
- func NotFunction(m *ast.Meta, name string) *LintError
- func ProtectedHTTPHeader(m *ast.Meta, name string) *LintError
- func TimeCalculatation(m *ast.Meta) *LintError
- func UndefinedAcl(m *ast.Meta, name string) *LintError
- func UndefinedBackend(m *ast.Meta, name string) *LintError
- func UndefinedBackendProperty(m *ast.Meta, name string) *LintError
- func UndefinedDirectorProperty(m *ast.Meta, name, dt string) *LintError
- func UndefinedFunction(m *ast.Meta, name string) *LintError
- func UndefinedGotoDestination(m *ast.Meta, name string) *LintError
- func UndefinedSubroutine(m *ast.Meta, name string) *LintError
- func UndefinedTableType(m *ast.Meta, name, tt string) *LintError
- func UndefinedVariable(m *ast.Meta, name string) *LintError
- func UnusedDeclaration(m *ast.Meta, name, declType string) *LintError
- func UnusedExternalDeclaration(name, declType string) *LintError
- func UnusedVariable(m *ast.Meta, name string) *LintError
- type Linter
- type Rule
- type Series
- type Severity
Constants ¶
View Source
const ( ACL_SYNTAX = "acl/syntax" ACL_DUPLICATED = "acl/duplicated" BACKEND_SYNTAX = "backend/syntax" BACKEND_DUPLICATED = "backend/duplicated" BACKEND_NOTFOUND = "backend/notfound" BACKEND_PROBER_CONFIGURATION = "backend/prober-configuration" DIRECTOR_SYNTAX = "director/syntax" DIRECTOR_DUPLICATED = "director/duplicated" DIRECTOR_PROPS_RANDOM = "director/props-random" DIRECTOR_PROPS_FALLBACK = "director/props-fallback" DIRECTOR_PROPS_HASH = "director/props-hash" DIRECTOR_PROPS_CLIENT = "director/props-client" DIRECTOR_PROPS_CHASH = "director/props-chash" DIRECTOR_BACKEND_REQUIRED = "director/backend-required" TABLE_SYNTAX = "table/syntax" TABLE_TYPE_VARIATION = "table/type-variation" TABLE_ITEM_LIMITATION = "table/item-limitation" TABLE_DUPLICATED = "table/duplicated" SUBROUTINE_SYNTAX = "subroutine/syntax" SUBROUTINE_BOILERPLATE_MACRO = "subroutine/boilerplate-macro" SUBROUTINE_DUPLICATED = "subroutine/duplicated" SUBROUTINE_INVALID_RETURN_TYPE = "subroutine/invalid-return-type" UNRECOGNIZE_CALL_SCOPE = "subroutine/unrecognize-call-scope" FORBID_VCL_PIPE = "subroutine/forbid-vcl-pipe" PENALTYBOX_SYNTAX = "penaltybox/syntax" PENALTYBOX_DUPLICATED = "penaltybox/duplicated" PENALTYBOX_NONEMPTY_BLOCK = "penaltybox/nonempty-block" RATECOUNTER_SYNTAX = "ratecounter/syntax" RATECOUNTER_DUPLICATED = "ratecounter/duplicated" RATECOUNTER_NONEMPTY_BLOCK = "ratecounter/nonempty-block" DECLARE_STATEMENT_SYNTAX = "declare-statement/syntax" DECLARE_STATEMENT_INVALID_TYPE = "declare-statement/invalid-type" DECLARE_STATEMENT_DUPLICATED = "declare-statement/duplicated" SET_STATEMENT_SYNTAX = "set-statement/syntax" OPERATOR_ASSIGNMENT = "operator/assignment" UNSET_STATEMENT_SYNTAX = "unset-statement/syntax" REMOVE_STATEMENT_SYNTAX = "remote-statement/syntax" OPERATOR_CONDITIONAL = "operator/conditional" RESTART_STATEMENT_SCOPE = "restart-statement/scope" ADD_STATEMENT_SYNTAX = "add-statement/syntax" CALL_STATEMENT_SYNTAX = "call-statement/syntax" CALL_STATEMENT_SUBROUTINE_NOTFOUND = "call-statement/subroutine-notfound" ERROR_STATEMENT_SCOPE = "error-statement/scope" ERROR_STATEMENT_CODE = "error-statement/code" SYNTHETIC_STATEMENT_SCOPE = "synthetic-statement/scope" SYNTHETIC_BASE64_STATEMENT_SCOPE = "synthetic-base64-statement/scope" GOTO_DUPLICATED = "goto/duplicated" GOTO_SYNTAX = "goto/syntax" CONDITION_LITERAL = "condition/literal" VALID_IP = "valid-ip" FUNCTION_ARGUMENTS = "function/arguments" FUNCTION_ARGUMENT_TYPE = "function/argument-type" INCLUDE_STATEMENT_MODULE_NOT_FOUND = "include/module-not-found" INCLUDE_STATEMENT_MODULE_LOAD_FAILED = "include/module-load-failed" REGEX_MATCHED_VALUE_MAY_OVERRIDE = "regex/matched-value-override" UNUSED_DECLARATION = "unused/declaration" UNUSED_VARIABLE = "unused/variable" UNUSED_GOTO = "unused/goto" DISALLOW_EMPTY_RETURN = "disallow-empty-return" FORBIDDEN_BACKWARD_JUMP = "goto/forbidden-backward-jump" TIME_CALCULATION = "operator/time-calculation" DEPRECATED = "deprecated" )
View Source
const CustomCommandPrefix = "falco-"
Variables ¶
View Source
var BackendProbePropertyTypes = map[string]types.Type{ "dummy": types.BoolType, "request": types.StringType, "expected_response": types.IntegerType, "interval": types.RTimeType, "timeout": types.RTimeType, "window": types.IntegerType, "initial": types.IntegerType, "threshold": types.IntegerType, "url": types.StringType, }
View Source
var BackendPropertyTypes = map[string]types.Type{ "dynamic": types.BoolType, "share_key": types.StringType, "host": types.StringType, "port": types.StringType, "ssl": types.BoolType, "ssl_cert_hostname": types.StringType, "max_tls_version": types.StringType, "min_tls_version": types.StringType, "ssl_check_cert": types.IDType, "ssl_sni_hostname": types.StringType, "between_bytes_timeout": types.RTimeType, "connect_timeout": types.RTimeType, "first_byte_timeout": types.RTimeType, "keepalive_time": types.RTimeType, "max_connections": types.IntegerType, "host_header": types.StringType, "always_use_host_header": types.BoolType, "bypass_local_route_table": types.BoolType, }
View Source
var DirectorPropertyTypes = map[string]DirectorProps{ "random": { Rule: DIRECTOR_PROPS_RANDOM, Props: map[string]types.Type{ "retries": types.IntegerType, "quorum": types.IntegerType, "backend": types.BackendType, "weight": types.IntegerType, }, Requires: []string{"weight"}, }, "fallback": { Rule: DIRECTOR_PROPS_FALLBACK, Props: map[string]types.Type{ "backend": types.BackendType, }, Requires: []string{}, }, "hash": { Rule: DIRECTOR_PROPS_HASH, Props: map[string]types.Type{ "quorum": types.IntegerType, "backend": types.BackendType, "weight": types.IntegerType, }, Requires: []string{"weight"}, }, "client": { Rule: DIRECTOR_PROPS_CLIENT, Props: map[string]types.Type{ "quorum": types.IntegerType, "backend": types.BackendType, "weight": types.IntegerType, }, Requires: []string{"weight"}, }, "chash": { Rule: DIRECTOR_PROPS_CHASH, Props: map[string]types.Type{ "key": types.BackendType, "seed": types.IntegerType, "vnodes_per_node": types.IntegerType, "quorum": types.IntegerType, "weight": types.IntegerType, "id": types.StringType, "backend": types.BackendType, }, Requires: []string{"id"}, }, "shield": { Props: map[string]types.Type{ "shield": types.StringType, "is_ssl": types.BoolType, }, Requires: []string{"shield"}, }, }
Functions ¶
This section is empty.
Types ¶
type CustomLinterCall ¶ added in v1.8.0
type CustomLinterCall struct {
// contains filtered or unexported fields
}
func (CustomLinterCall) Rule ¶ added in v1.8.0
func (c CustomLinterCall) Rule() string
type DirectorProps ¶
type FatalError ¶ added in v0.9.3
type LintError ¶
type LintError struct { Severity Severity Token token.Token Message string Reference string Rule Rule }
func CustomLinterCommandFailed ¶ added in v1.8.0
func CustomLinterCommandNotFound ¶ added in v1.8.0
func DeprecatedVariable ¶ added in v1.11.0
func DuplicatedUseForGotoDestination ¶ added in v0.9.3
func ForbiddenBackwardJump ¶ added in v1.7.0
func ForbiddenBackwardJump(gs *ast.GotoStatement) *LintError
func FromPluginError ¶ added in v1.8.0
func ImplicitTypeConversion ¶
func InvalidReturnState ¶
func InvalidStringConcatenation ¶ added in v1.11.0
func InvalidType ¶
InvalidType raises ERROR due to strict type assertion failed. Actually, it cause compile error for that VCL.
func InvalidTypeComparison ¶
func InvalidTypeExpression ¶
func InvalidTypeOperator ¶
func NonEmptyPenaltyboxBlock ¶ added in v0.9.3
func NonEmptyRatecounterBlock ¶ added in v0.9.3
func ProtectedHTTPHeader ¶ added in v0.9.3
func TimeCalculatation ¶ added in v1.11.0
func UndefinedGotoDestination ¶ added in v0.9.3
func UnusedDeclaration ¶ added in v0.6.0
func UnusedExternalDeclaration ¶ added in v0.9.3
type Linter ¶
type Linter struct { Errors []*LintError FatalError *FatalError // contains filtered or unexported fields }
func New ¶
func New(c *config.LinterConfig, opts ...optionFunc) *Linter
type Series ¶ added in v1.11.0
type Series struct { Operator string // Operator will accept either of "+" or "-" or empty string. Expression ast.Expression }
Series expresses the series of string concatenation.
Click to show internal directories.
Click to hide internal directories.