Documentation
¶
Overview ¶
Package gotypes resolves Go contracts referenced from .gwdk component files.
Index ¶
- func EffectiveImportAlias(item gwdkir.Import) (string, error)
- func ImportPathForAlias(imports []gwdkir.Import, alias string) (string, error)
- func RunStateInitJSON(imports []gwdkir.Import, state gwdkir.StateContract) ([]byte, error)
- func ValidateImportPath(importPath string) error
- func ValidateStateInit(imports []gwdkir.Import, state gwdkir.StateContract) error
- type Field
- type Struct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EffectiveImportAlias ¶
EffectiveImportAlias returns the explicit import alias or the package name used by Go for an unaliased import.
func ImportPathForAlias ¶
ImportPathForAlias returns the concrete Go import path for a .gwdk import alias and rejects relative import paths.
func RunStateInitJSON ¶
RunStateInitJSON runs a declared state init function and returns its JSON encoding.
func ValidateImportPath ¶
ValidateImportPath rejects relative or malformed import paths in component contracts.
func ValidateStateInit ¶
func ValidateStateInit(imports []gwdkir.Import, state gwdkir.StateContract) error
ValidateStateInit verifies that the state init function can initialize the declared state type.
Types ¶
type Struct ¶
Struct describes a resolved Go struct type.
func ResolveStruct ¶
ResolveStruct resolves a Go struct type referenced by a component contract.
func (Struct) FieldNames ¶
FieldNames returns the resolved struct fields in source/type-checker order.