shape

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	*Info
	Args ShapeList `json:"args"`
}

for generics

func (Container) Clone added in v0.0.4

func (s Container) Clone() Shape

func (Container) Format

func (v Container) Format(f fmt.State, c rune)

type Extractor added in v0.0.4

type Extractor struct {
	Seen map[reflect.Type]Shape

	ArglistLookup  *arglist.Lookup
	RevisitArglist bool
}

func NewExtractor added in v0.0.11

func NewExtractor() *Extractor

func (*Extractor) Extract added in v0.0.4

func (e *Extractor) Extract(ob interface{}) Shape

type FieldMetadata

type FieldMetadata struct {
	Anonymous bool // embedded?
	FieldName string
	Required  bool
}

type Function

type Function struct {
	*Info
	Params  ShapeMap `json:"params"`  // for function's In
	Returns ShapeMap `json:"returns"` // for function's Out
}

func (Function) Clone added in v0.0.4

func (s Function) Clone() Shape

func (Function) Format

func (v Function) Format(f fmt.State, c rune)

type Identity added in v0.0.7

type Identity string

type Info

type Info struct {
	Kind    Kind   `json:"kind"`
	Name    string `json:"name"`
	Lv      int    `json:"lv"` // v is 0, *v is 1
	Package string `json:"package"`
	// contains filtered or unexported fields
}

func (*Info) Clone added in v0.0.4

func (v *Info) Clone() *Info

func (*Info) GetFullName

func (v *Info) GetFullName() string

func (*Info) GetIdentity added in v0.0.7

func (v *Info) GetIdentity() Identity

func (*Info) GetLv added in v0.0.4

func (v *Info) GetLv() int

func (*Info) GetName

func (v *Info) GetName() string

func (*Info) GetPackage

func (v *Info) GetPackage() string

func (*Info) GetReflectKind

func (v *Info) GetReflectKind() reflect.Kind

func (*Info) GetReflectType

func (v *Info) GetReflectType() reflect.Type

func (*Info) GetReflectValue

func (v *Info) GetReflectValue() reflect.Value

func (*Info) ResetName added in v0.0.5

func (v *Info) ResetName(name string)

func (*Info) ResetPackage added in v0.0.5

func (v *Info) ResetPackage(name string)

func (*Info) ResetReflectType added in v0.0.6

func (v *Info) ResetReflectType(rt reflect.Type)

func (*Info) Shape

func (v *Info) Shape() string

type Interface

type Interface struct {
	*Info
	Methods ShapeMap `json:"methods"`
}

func (Interface) Clone added in v0.0.4

func (s Interface) Clone() Shape

func (Interface) Format

func (v Interface) Format(f fmt.State, c rune)

type Kind

type Kind reflect.Kind

func (Kind) MarshalJSON

func (k Kind) MarshalJSON() ([]byte, error)

func (Kind) String

func (k Kind) String() string

type Primitive

type Primitive struct {
	*Info
}

func (Primitive) Clone added in v0.0.4

func (v Primitive) Clone() Shape

func (Primitive) Format

func (v Primitive) Format(f fmt.State, c rune)

type Shape

type Shape interface {
	Shape() string

	GetName() string
	GetFullName() string
	GetPackage() string
	GetLv() int

	ResetName(string)
	ResetPackage(string)
	ResetReflectType(reflect.Type)

	GetReflectKind() reflect.Kind
	GetReflectType() reflect.Type
	GetReflectValue() reflect.Value

	GetIdentity() Identity

	Clone() Shape
	// contains filtered or unexported methods
}

func Extract

func Extract(ob interface{}) Shape

type ShapeList

type ShapeList []Shape

type ShapeMap

type ShapeMap struct {
	Keys   []string `json:"keys"`
	Values []Shape  `json:"values"`
}

func (*ShapeMap) Len added in v0.0.6

func (m *ShapeMap) Len() int

type Struct

type Struct struct {
	*Info
	Fields   ShapeMap `json:"fields"`
	Tags     []reflect.StructTag
	Metadata []FieldMetadata
}

func (Struct) Clone added in v0.0.4

func (s Struct) Clone() Shape

func (*Struct) FieldName

func (v *Struct) FieldName(i int) string

func (Struct) Format

func (v Struct) Format(f fmt.State, c rune)

type Unknown

type Unknown struct {
	*Info
}

func (Unknown) Clone added in v0.0.4

func (s Unknown) Clone() Shape

func (Unknown) Format

func (v Unknown) Format(f fmt.State, c rune)

Jump to

Keyboard shortcuts

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