Documentation ¶
Index ¶
- Constants
- Variables
- type DirectorProps
- type LintError
- func AccessDenined(m *ast.Meta, name, scope string) *LintError
- func Duplicated(m *ast.Meta, name, ident string) *LintError
- func ErrorCodeRange(m *ast.Meta, code int64) *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 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, expects ...types.Type) *LintError
- func InvalidValue(m *ast.Meta, tt, val string) *LintError
- func NotFunction(m *ast.Meta, name string) *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 UndefinedSubroutine(m *ast.Meta, name string) *LintError
- func UndefinedTableType(m *ast.Meta, name, tt string) *LintError
- func UndefinedVariable(m *ast.Meta, name string) *LintError
- type Linter
- type Rule
- 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" 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" 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" CONDITION_LITERAL = "condition/literal" VALID_IP = "valid-ip" FUNCTION_ARGUMENS = "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" )
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, }
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, "ssl_check_cert": types.IDType, "ssl_sni_hostname": types.StringType, "between_bytes_timeout": types.RTimeType, "connect_timeout": types.RTimeType, "first_byte_timeout": types.RTimeType, "max_connections": types.IntegerType, "host_header": types.StringType, "always_use_host_header": types.BoolType, }
View Source
var DirectorPropertyTypes = map[string]DirectorProps{ "random": { Rule: DIRECTOR_PROPS_RANDOM, Props: map[string]types.Type{ "retries": types.IntegerType, "quorum": types.StringType, "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.StringType, "backend": types.BackendType, "weight": types.IntegerType, }, Requires: []string{"weight"}, }, "client": { Rule: DIRECTOR_PROPS_CLIENT, Props: map[string]types.Type{ "quorum": types.StringType, "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.StringType, "weight": types.IntegerType, "id": types.StringType, }, Requires: []string{"id"}, }, }
View Source
var ValueTypeMap = map[string]types.Type{ "INTEGER": types.IntegerType, "FLOAT": types.FloatType, "BOOL": types.BoolType, "ACL": types.AclType, "BACKEND": types.BackendType, "IP": types.IPType, "STRING": types.StringType, "ID": types.IDType, "RTIME": types.RTimeType, "TIME": types.TimeType, }
Functions ¶
This section is empty.
Types ¶
type DirectorProps ¶
type LintError ¶
type LintError struct { Severity Severity Token token.Token Message string Reference string Rule Rule }
func ImplicitTypeConversion ¶
func InvalidOperator ¶
FIXME: accept *ast.Meta
func InvalidReturnState ¶
func InvalidTypeComparison ¶
func InvalidTypeExpression ¶
func InvalidTypeOperator ¶
FIXME: accept *ast.Meta
Click to show internal directories.
Click to hide internal directories.