object

package
v0.0.0-...-33c70f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	SchemaName string
	*schema.Schema
}

type Definitions

type Definitions map[string]*schema.Schema

func (Definitions) Find

func (defs Definitions) Find(name string) (*schema.Schema, bool)

type Mappings

type Mappings struct {
	// contains filtered or unexported fields
}

func NewMapping

func NewMapping(root *schema.Schema) Mappings

func (*Mappings) AddPair

func (o *Mappings) AddPair(pair Pair)

func (Mappings) FindByExpr

func (o Mappings) FindByExpr(t ast.Expr) (Pair, bool)

func (Mappings) FindBySchemaName

func (o Mappings) FindBySchemaName(name string) (Pair, bool)

func (Mappings) FindByStructName

func (o Mappings) FindByStructName(name string) (Pair, bool)

func (Mappings) ForEach

func (o Mappings) ForEach(cb func(index int, pair Pair) (bool, error)) error

func (*Mappings) InspectCallback

func (o *Mappings) InspectCallback(node ast.Node) bool

func (Mappings) MapFields

func (o Mappings) MapFields(list []*ast.Field) map[string]*ast.Field

type Pair

type Pair struct {
	Object     *ast.TypeSpec
	Definition Definition
}

func (Pair) IsSchemaResolved

func (p Pair) IsSchemaResolved() bool

func (Pair) StructName

func (p Pair) StructName() string

type Properties

type Properties struct {
	Props    map[string]*schema.Schema
	Required []string
}

func MapProperties

func MapProperties(sch *schema.Schema) (Properties, error)

type Verifier

type Verifier struct {
	Objects       Mappings
	Schema        *schema.Schema
	ReportSkipped bool
}

func NewVerifier

func NewVerifier(objects Mappings, reportSkipped bool) Verifier

func (Verifier) Verify

func (o Verifier) Verify(pass *analysis.Pass) (interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL