Documentation
¶
Index ¶
- func FormatCheckReport(report CheckReport) (string, error)
- func FormatFileCheckReports(reports []FileCheckReport) (string, error)
- func ImportJSON(input string) (string, error)
- func ImportJSONFile(path string) (string, error)
- func ImportJSONSchema(input string) (string, error)
- func ImportTOML(input string) (string, error)
- func ImportYAML(input string) (string, error)
- func Marshal(value any) (string, error)
- func MarshalOutput(value any) (string, error)
- func OutputMap(result Result) map[string]any
- func Unmarshal(input string, target any) error
- func UnmarshalWithInjections(input string, injections map[string]any, target any) error
- func UnmarshalWithInput(input string, values map[string]any, target any) error
- type CheckIssue
- type CheckReport
- type FileCheckReport
- type Result
- func Parse(input string) (Result, error)
- func ParseFile(path string) (Result, error)
- func ParseFileWithInjections(path string, injections map[string]any) (Result, error)
- func ParseFileWithInput(path string, values map[string]any) (Result, error)
- func ParseWithInjections(input string, injections map[string]any) (Result, error)
- func ParseWithInput(input string, values map[string]any) (Result, error)
- type SchemaField
- type SchemaType
- type SchemaTypeKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatCheckReport ¶
func FormatCheckReport(report CheckReport) (string, error)
func FormatFileCheckReports ¶
func FormatFileCheckReports(reports []FileCheckReport) (string, error)
func ImportJSON ¶
func ImportJSONFile ¶
func ImportJSONSchema ¶
func ImportTOML ¶
func ImportYAML ¶
func MarshalOutput ¶
func UnmarshalWithInjections ¶
Types ¶
type CheckIssue ¶
type CheckIssue struct {
Path string `json:"path"`
Reason string `json:"reason"`
Format string `json:"format"`
Key string `json:"key,omitempty"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
Actual string `json:"actual,omitempty"`
Expected string `json:"expected,omitempty"`
}
type CheckReport ¶
type CheckReport struct {
Syntax []CheckIssue `json:"syntax"`
KeyIncompatibility []CheckIssue `json:"key_incompatibility"`
TypeIncompatibility []CheckIssue `json:"type_incompatibility"`
StructureIncompatibility []CheckIssue `json:"structure_incompatibility"`
}
func CheckJSON ¶
func CheckJSON(input string) CheckReport
func CheckTOML ¶
func CheckTOML(input string) CheckReport
func CheckYAML ¶
func CheckYAML(input string) CheckReport
func (CheckReport) HasIssues ¶
func (report CheckReport) HasIssues() bool
type FileCheckReport ¶
type FileCheckReport struct {
Path string `json:"path"`
Format string `json:"format"`
Errors CheckReport `json:"errors"`
}
func CheckFile ¶
func CheckFile(path string) (FileCheckReport, error)
type Result ¶
type Result struct {
Data map[string]any
Schema map[SchemaField]SchemaType
}
func ParseFileWithInjections ¶
func ParseFileWithInput ¶
func ParseWithInjections ¶
type SchemaField ¶
type SchemaType ¶
type SchemaType struct {
Kind SchemaTypeKind
Name string
Element *SchemaType
Fields map[SchemaField]SchemaType
Members []SchemaType
}
type SchemaTypeKind ¶
type SchemaTypeKind int
const ( SchemaTypeUnknown SchemaTypeKind = iota SchemaTypePrimitive SchemaTypeNamed SchemaTypeArray SchemaTypeRecord SchemaTypeUnion SchemaTypeVariant SchemaTypeRecordMap )
Click to show internal directories.
Click to hide internal directories.