types

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SearchUpDirLimit = 5

Variables

This section is empty.

Functions

func ArgIsContext added in v0.1.1

func ArgIsContext(arg Arg) bool

func ArgIsError added in v0.1.1

func ArgIsError(arg Arg) bool

func IsBuiltIn added in v0.1.0

func IsBuiltIn(s string) bool

Types

type Arg

type Arg struct {
	Name         string
	Type         Type
	Dependencies []Import
}

func (Arg) String

func (a Arg) String() string

type Args

type Args []*Arg

func (Args) HasContext added in v0.1.1

func (a Args) HasContext() bool

func (Args) HasError added in v0.1.1

func (a Args) HasError() bool

func (Args) String

func (a Args) String() string

func (Args) UnexportedNames added in v0.1.1

func (a Args) UnexportedNames(exclude ...string) string

type BaseType

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

func (*BaseType) ImportPath

func (t *BaseType) ImportPath() string

func (*BaseType) IsBuiltin added in v0.1.0

func (t *BaseType) IsBuiltin() bool

func (*BaseType) IsImported

func (t *BaseType) IsImported() bool

func (*BaseType) IsInterface

func (t *BaseType) IsInterface() bool

func (*BaseType) Name

func (t *BaseType) Name() string

func (*BaseType) Package

func (t *BaseType) Package() string

func (*BaseType) SetIsInterface

func (t *BaseType) SetIsInterface()

func (*BaseType) String

func (t *BaseType) String() string

type Dependency

type Dependency struct {
	Module  string
	Version string
	Path    string
}

type Ellipsis

type Ellipsis struct{ Type }

func (Ellipsis) String

func (e Ellipsis) String() string

type ExchangeStruct

type ExchangeStruct struct {
	StructName  string
	Fields      Args
	HasContext  bool
	IsInterface bool
}

type Extractor added in v0.1.0

type Extractor interface {
	Types() ([]*Interface, []*Struct)
	Interfaces() []*Interface
	Structs() []*Struct
}

type Field

type Field struct {
	Name string
	Type Type
	Tag  string
}

Field exported type TODO: edit

type GenericType

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

func (*GenericType) ImportPath

func (t *GenericType) ImportPath() string

func (*GenericType) IsBuiltin added in v0.1.0

func (t *GenericType) IsBuiltin() bool

func (*GenericType) IsImported

func (t *GenericType) IsImported() bool

func (*GenericType) IsInterface

func (t *GenericType) IsInterface() bool

func (*GenericType) Name

func (t *GenericType) Name() string

func (*GenericType) Package

func (t *GenericType) Package() string

func (*GenericType) SetIsInterface

func (t *GenericType) SetIsInterface()

func (*GenericType) String

func (t *GenericType) String() string

type GoFile added in v0.1.0

type GoFile struct {
	FilePath   string
	Module     string
	ModulePath string
	Package    string
	FSet       *token.FileSet
	AST        *ast.File
}

func (GoFile) ImportPath added in v0.1.0

func (f GoFile) ImportPath() string

type Import

type Import struct {
	Name string
	Path string
}

func (Import) IsAliasedImportRequired

func (i Import) IsAliasedImportRequired() bool

type Interface

type Interface struct {
	Name         string
	Methods      []Method
	Dependencies []Import
	ImportPath   string
	Package      string
}

type MapType

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

func (*MapType) ImportPath

func (t *MapType) ImportPath() string

func (*MapType) IsBuiltin added in v0.1.0

func (t *MapType) IsBuiltin() bool

func (*MapType) IsImported

func (t *MapType) IsImported() bool

func (*MapType) IsInterface

func (t *MapType) IsInterface() bool

func (*MapType) Name

func (t *MapType) Name() string

func (*MapType) Package

func (t *MapType) Package() string

func (*MapType) SetIsInterface

func (t *MapType) SetIsInterface()

func (*MapType) String

func (t *MapType) String() string

type Method

type Method struct {
	Name         string
	Args         Args
	Results      Results
	Dependencies []Import
}

func (Method) String

func (m Method) String() string

type Module added in v0.1.0

type Module struct {
	Name     string
	Path     string
	Packages map[string]*Package
	Version  string
}

type ModuleMap added in v0.1.0

type ModuleMap map[string]*Module

func (ModuleMap) Add added in v0.1.0

func (m ModuleMap) Add(f *GoFile) error

type Package added in v0.1.0

type Package struct {
	Name       string
	ImportPath string
	Path       string
	Files      map[string]*GoFile
	Structs    map[string]*Struct
	Interfaces map[string]*Interface
}

func NewPackageFromGoFile added in v0.1.0

func NewPackageFromGoFile(f *GoFile) *Package

type Pointer

type Pointer struct{ Type }

func (Pointer) String

func (p Pointer) String() string

type ProtoField

type ProtoField struct {
	Type   string
	Name   string
	Number uint
	OneOf  bool
}

func (ProtoField) String

func (p ProtoField) String() string

type ProtoFile

type ProtoFile struct {
	GoPackage     string
	GoPackagePath string
	Package       string
	Services      []ProtoService
	Messages      []ProtoMessage
	Imports       []ProtoImport
}

type ProtoImport added in v0.1.0

type ProtoImport struct {
	Path string
}

type ProtoMessage

type ProtoMessage struct {
	Name   string
	Fields []ProtoField
}

type ProtoRPC

type ProtoRPC struct {
	Name     string
	Request  ProtoMessage
	Response ProtoMessage
}

type ProtoService

type ProtoService struct {
	Name   string
	Fields []ProtoRPC
}

type Results

type Results struct{ Args }

func (Results) String

func (r Results) String() string

type Slice

type Slice struct{ Type }

func (Slice) String

func (p Slice) String() string

type Struct

type Struct struct {
	Name        string
	Fields      []Field
	UsedImports []Import
	ImportPath  string
	Package     string
}

Struct exported type TODO: edit

type Type

type Type interface {
	Name() string
	Package() string
	String() string
	ImportPath() string
	IsImported() bool
	IsInterface() bool
	IsBuiltin() bool
	SetIsInterface()
}

func NewGenericType

func NewGenericType(name, index Type) Type

func NewMapType

func NewMapType(k, v Type) Type

func NewType

func NewType(name, pkg, importPath string) Type

type TypeData added in v0.1.0

type TypeData struct {
	Type      Type
	Struct    *Struct
	Interface *Interface
}

type TypeMap added in v0.1.0

type TypeMap map[string]TypeData

func (TypeMap) Add added in v0.1.0

func (m TypeMap) Add(t Type)

func (TypeMap) Contains added in v0.1.0

func (m TypeMap) Contains(s string) bool

func (TypeMap) ContainsType added in v0.1.0

func (m TypeMap) ContainsType(t Type) bool

func (TypeMap) Get added in v0.1.0

func (m TypeMap) Get(t Type) TypeData

func (TypeMap) Set added in v0.1.0

func (m TypeMap) Set(t Type, data TypeData)

Jump to

Keyboard shortcuts

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