reader

package
v0.0.0-...-5ded2de Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	GoTypeRep        []GoTypeRepresentation
	APIFuncs         map[string][]FunctionSignature
	ApiPkgName       string
	ImportDictionary map[string]string              // Package name to import path from go mod
	ValueDecl        map[string][]map[string]string // Constants and var declarations found
}

func ParseFile

func ParseFile(path string, mName string) (*Data, error)

type FunctionSignature

type FunctionSignature struct {
	Name    string
	Params  []TypeSignature
	Results []TypeSignature
}

type GenericType

type GenericType int
const (
	GenericTypeUnknown GenericType = 0
	GenericTypeStruct  GenericType = 1
	GenericTypeEnum    GenericType = 2
)

type GoTypeRepresentation

type GoTypeRepresentation struct {
	Name       string
	Pkg        string
	ImportPath string
	Fields     []TypeSignature // This will only have a value if the GenericType is set to Struct
	Type       GenericType
	Kind       string // This will only have a value if the GenericType is set to Enum
}

type Reader

type Reader struct {
	CurrGoPkg string
	// contains filtered or unexported fields
}

func (*Reader) CheckFunctionSignature

func (r *Reader) CheckFunctionSignature(fn *ast.FuncType) FunctionSignature

func (*Reader) ListInterfaceMethods

func (r *Reader) ListInterfaceMethods(it *ast.InterfaceType) []FunctionSignature

ListInterfaceMethods returns the function signatures of all the interface methods

func (*Reader) ListStructProperties

func (r *Reader) ListStructProperties(it *ast.StructType) []TypeSignature

ListInterfaceMethods returns the function signatures of all the interface methods

type SignatureType

type SignatureType int
const (
	SignatureTypeUnknown SignatureType = 0
	SignatureTypeSingle  SignatureType = 1
	SignatureTypeSlice   SignatureType = 2
)

type TypeSignature

type TypeSignature struct {
	Name      string
	Kind      string
	Type      SignatureType
	GoPackage string
}

Jump to

Keyboard shortcuts

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