Documentation
¶
Index ¶
- func ConfigRequired(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func CoverageCheck(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func FieldRequired(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func ForbiddenRef(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func IsArchived(ctx toulmin.Context, _ toulmin.Specs) (bool, any)
- func IsCustomTS(ctx toulmin.Context, _ toulmin.Specs) (bool, any)
- func IsDTO(ctx toulmin.Context, _ toulmin.Specs) (bool, any)
- func IsImplicitVar(ctx toulmin.Context, _ toulmin.Specs) (bool, any)
- func IsNoSensitive(ctx toulmin.Context, _ toulmin.Specs) (bool, any)
- func IsPkgModel(ctx toulmin.Context, _ toulmin.Specs) (bool, any)
- func IsSensitiveCol(ctx toulmin.Context, _ toulmin.Specs) (bool, any)
- func IsSkipped(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func IsSubscribe(ctx toulmin.Context, _ toulmin.Specs) (bool, any)
- func ModelRefExists(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func NameFormat(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func PairMatch(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func RefExists(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func SchemaMatch(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func TypeMatch(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- func VarDeclared(ctx toulmin.Context, specs toulmin.Specs) (bool, any)
- type BaseSpec
- type ConfigRequiredSpec
- type CoverageCheckSpec
- type Evidence
- type FieldConstraint
- type FieldRequiredSpec
- type FilterSpec
- type ForbiddenRefSpec
- type Ground
- type MethodInfo
- type ModelInfo
- type ModelRefExistsSpec
- type NameFormatSpec
- type OperationInfo
- type PaginationSpec
- type PairMatchSpec
- type PathParam
- type RefExistsSpec
- type RequestSchemaInfo
- type SchemaEvidence
- type SchemaMatchSpec
- type SkipSpec
- type SortSpec
- type StringSet
- type TableInfo
- type TypeClaim
- type TypeMatchSpec
- type VarDeclaredSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigRequired ¶
ConfigRequired checks that a config key is set. claim: ignored. Returns (true, evidence) when the key is NOT set.
func CoverageCheck ¶
CoverageCheck checks that a defined item is used somewhere. claim: string (defined item name). Returns (true, evidence) when NOT used.
func FieldRequired ¶
FieldRequired checks that a field is present or absent. claim: map[string]bool (field name -> has value). Required=true: must be present. Required=false: must be absent.
func ForbiddenRef ¶
ForbiddenRef checks that a name is NOT in the forbidden set. claim: string (name). Returns (true, evidence) when name IS found (violation).
func IsArchived ¶
IsArchived checks if the current table is marked @archived. Ground.Flags["archived"] must be set by the caller.
func IsCustomTS ¶
IsCustomTS checks if the claimed field exists in custom.ts. Ground.Flags["customTS.<name>"] must be set by the caller. claim: string (field name).
func IsDTO ¶
IsDTO checks if the current type is marked // @dto. Ground.Flags["dto"] must be set by the caller.
func IsImplicitVar ¶
IsImplicitVar checks if the claimed variable is implicitly declared. Ground.Flags["implicit.<name>"] must be set by the caller. claim: string (variable name).
func IsNoSensitive ¶
IsNoSensitive checks if the current column has @nosensitive annotation. Ground.Flags["nosensitive"] must be set by the caller.
func IsPkgModel ¶
IsPkgModel checks if the current model is a pkg model (no DDL table). Ground.Flags["pkgModel"] must be set by the caller.
func IsSensitiveCol ¶
IsSensitiveCol checks if the current column has @sensitive annotation. Ground.Flags["sensitive"] must be set by the caller.
func IsSkipped ¶
IsSkipped checks if a SSOT kind is excluded via --skip flag. Ground.Flags["skipped.<kind>"] must be set by the caller.
func IsSubscribe ¶
IsSubscribe checks if the current function is a @subscribe handler. Ground.Flags["subscribe"] must be set by the caller.
func ModelRefExists ¶
ModelRefExists checks that a referenced model name exists in Ground.Models. claim: string (model name). Returns (true, evidence) when NOT found. 구조적 g.Models 기반이라 legacy Lookup["SymbolTable.model"] 을 대체한다.
func NameFormat ¶
NameFormat checks that a name satisfies a format rule. claim: string (name). Returns (true, evidence) when format violated.
func PairMatch ¶
PairMatch checks that a (key:value) pair exists in the target. claim: string ("key:value" joined). Returns (true, evidence) when NOT found.
func RefExists ¶
RefExists checks that a referenced name exists in the target. claim: string (reference name). Returns (true, evidence) when NOT found.
func SchemaMatch ¶
SchemaMatch checks that source fields exist in the target schema. claim: []string (source field names). Returns (true, evidence) when any missing.
Types ¶
type BaseSpec ¶
BaseSpec provides common fields for all rule specs. Embed this in concrete spec types to satisfy toulmin.Spec.
type ConfigRequiredSpec ¶
ConfigRequiredSpec configures a ConfigRequired rule. ConfigKey selects which Ground.Config key must be set.
type CoverageCheckSpec ¶
CoverageCheckSpec configures a CoverageCheck rule. LookupKey selects which Ground.Lookup set to check usage against.
type FieldConstraint ¶
type FieldConstraint struct {
Required bool
Format string
MinLength *int
MaxLength *int
Minimum *float64
Maximum *float64
Pattern string
Enum []string
}
FieldConstraint — 필드 하나의 JSON Schema 제약.
type FieldRequiredSpec ¶
FieldRequiredSpec configures a FieldRequired rule. Required=true means the field must be present; false means absent.
type ForbiddenRefSpec ¶
ForbiddenRefSpec configures a ForbiddenRef rule. LookupKey selects which Ground.Lookup set holds forbidden names.
type Ground ¶
type Ground struct {
// 기존 — 주로 validate/crosscheck 소비
Lookup map[string]StringSet // "target.kind" -> set of names
Types map[string]string // "target.kind.name" -> type string
Pairs map[string]StringSet // "target.pairKind" -> set of "key:value"
Config map[string]bool // config key -> present
Vars StringSet // declared variable names
Flags StringSet // flags for defeaters
Schemas map[string][]string // "target.schema" -> ordered field list
// 신규 — 주로 generate 소비 (Phase002)
Models map[string]ModelInfo // "User" → {Methods}
Tables map[string]TableInfo // "users" → {Columns, ColumnOrder}
Ops map[string]OperationInfo // operationID → operation 메타
ReqSchemas map[string]RequestSchemaInfo // operationID → requestBody 필드 제약
}
Ground holds lookup data for validation rules and code generation. Populated by the caller, stored in ctx via ctx.Set("ground", g).
type MethodInfo ¶
type MethodInfo struct {
Cardinality string // "one" / "many" / "exec" (sqlc 유래 또는 빈값)
Params []string // 매개변수 이름 순서 (sqlc 의 $N 또는 iface 시그니처 유래)
ErrStatus int // FuncSpec @error 코드 (기본 0 = 미지정)
}
MethodInfo — 모델 메서드 하나의 메타.
type ModelInfo ¶
type ModelInfo struct {
Name string
Methods map[string]MethodInfo
}
ModelInfo — Go 인터페이스 + sqlc 쿼리 + FuncSpec @error 가 결합된 모델 메타. 키는 일반 모델명("User") 또는 @call 함수 모델("auth._func").
type ModelRefExistsSpec ¶
type ModelRefExistsSpec struct {
BaseSpec
}
ModelRefExistsSpec configures a ModelRefExists rule. Ground.Models 를 조회하므로 LookupKey 가 불필요하다.
type NameFormatSpec ¶
NameFormatSpec configures a NameFormat rule. Pattern: "uppercase-start", "no-dot-prefix", "dot-method".
type OperationInfo ¶
type OperationInfo struct {
ID string
Method string
Path string
PathParams []PathParam
HasRequestBody bool
Pagination *PaginationSpec
Sort *SortSpec
Filter *FilterSpec
}
OperationInfo — OpenAPI operation 하나의 메타. Pagination/Sort/Filter 는 해당 x- 확장이 있을 때만 nil 이 아님.
type PaginationSpec ¶
PaginationSpec — x-pagination.
type PairMatchSpec ¶
PairMatchSpec configures a PairMatch rule. LookupKey selects which Ground.Pairs set to check against.
type RefExistsSpec ¶
RefExistsSpec configures a RefExists rule. LookupKey selects which Ground.Lookup set to check against.
type RequestSchemaInfo ¶
type RequestSchemaInfo struct {
Fields map[string]FieldConstraint
}
RequestSchemaInfo — OpenAPI requestBody 의 필드 제약 집합.
type SchemaEvidence ¶
SchemaEvidence extends Evidence with missing field details.
type SchemaMatchSpec ¶
SchemaMatchSpec configures a SchemaMatch rule. LookupKey selects which Ground.Schemas to check against.
type SkipSpec ¶
SkipSpec configures an IsSkipped defeater. Kind is the SSOT kind to check (e.g., "DDL", "SSaC").
type TableInfo ¶
TableInfo — DDL 테이블의 컬럼 메타. Columns 는 이름→타입 조회용 맵, ColumnOrder 는 원본 DDL 선언 순서 (map 비결정성 해소).
type TypeMatchSpec ¶
TypeMatchSpec configures a TypeMatch rule. LookupKey is the prefix into Ground.Types (appends ".name").
type VarDeclaredSpec ¶
type VarDeclaredSpec struct {
BaseSpec
}
VarDeclaredSpec configures a VarDeclared rule.
Source Files
¶
- base_spec.go
- base_spec_spec_name.go
- base_spec_validate.go
- config_required.go
- config_required_spec.go
- coverage_check.go
- coverage_check_spec.go
- evidence.go
- field_required.go
- field_required_spec.go
- forbidden_ref.go
- forbidden_ref_spec.go
- ground.go
- ground_types.go
- is_archived.go
- is_custom_ts.go
- is_dto.go
- is_implicit_var.go
- is_no_sensitive.go
- is_pkg_model.go
- is_sensitive_col.go
- is_skipped.go
- is_subscribe.go
- model_ref_exists.go
- model_ref_exists_spec.go
- name_format.go
- name_format_spec.go
- pair_match.go
- pair_match_spec.go
- ref_exists.go
- ref_exists_spec.go
- schema_evidence.go
- schema_match.go
- schema_match_spec.go
- skip_spec.go
- string_set.go
- type_claim.go
- type_match.go
- type_match_spec.go
- var_declared.go
- var_declared_spec.go