Documentation ¶
Index ¶
- Constants
- Variables
- type DirectorProps
- type LintError
- func AccessDenined(t token.Token, name, scope string) *LintError
- func Duplicated(t token.Token, name, ident string) *LintError
- func ErrorCodeRange(t token.Token, code int64) *LintError
- func FunctionArgumentMismatch(t token.Token, name string, expect, actual int) *LintError
- func FunctionArgumentTypeMismatch(t token.Token, name string, num int, expect, actual types.Type) *LintError
- func ImplicitTypeConversion(t token.Token, from, to types.Type) *LintError
- func InvalidName(t token.Token, name, ident string) *LintError
- func InvalidOperation(t token.Token, name, operation string) *LintError
- func InvalidOperator(t token.Token, op string, left types.Type) *LintError
- func InvalidReturnState(t token.Token, scope, state string, expects ...string) *LintError
- func InvalidType(t token.Token, name string, expect, actual types.Type) *LintError
- func InvalidTypeComparison(t token.Token, left, right types.Type) *LintError
- func InvalidTypeConversion(t token.Token, vclType string) *LintError
- func InvalidTypeExpression(t token.Token, actual types.Type, expects ...types.Type) *LintError
- func InvalidTypeOperator(t token.Token, op string, expects ...types.Type) *LintError
- func InvalidValue(t token.Token, tt, val string) *LintError
- func NotFunction(t token.Token, name string) *LintError
- func UndefinedAcl(t token.Token, name string) *LintError
- func UndefinedBackend(t token.Token, name string) *LintError
- func UndefinedBackendProperty(t token.Token, name string) *LintError
- func UndefinedDirectorProperty(t token.Token, name, dt string) *LintError
- func UndefinedFunction(t token.Token, name string) *LintError
- func UndefinedSubroutine(t token.Token, name string) *LintError
- func UndefinedTableType(t token.Token, name, tt string) *LintError
- func UndefinedVariable(t token.Token, 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 InvalidReturnState ¶
func InvalidType ¶
func InvalidTypeComparison ¶
func InvalidTypeExpression ¶
func InvalidTypeOperator ¶
Click to show internal directories.
Click to hide internal directories.