model

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package model contains models for transmission between the analyzer and the printer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Name string // Name of the argument.

	IsPointer   *ArgumentPointer   // Argument is a pointer of type, contains another type.
	IsArray     *ArgumentArray     // Argument is a slice of types, element of the slice in this field.
	IsFunc      *Method            // Argument is a func, can contains params and results.
	IsMap       *ArgumentMap       // Argument is a map, contains key and value of the map.
	IsChan      *ArgumentChan      // Argument is a channel, contains direction and types.
	IsStruct    *ArgumentStruct    // Argument is a anon struct, contains fields.
	IsInterface *ArgumentInterface // Argument is a anon inerface, contains methods.
	IsNamed     *Argument          // Argument is a named type.

	Package   string          // Package path of the type.
	TypeName  string          // Type name without package prefix (int, byte, Data).
	BasicInfo types.BasicInfo // Basic info of the type.
}

Argument of the method inerface.

type ArgumentArray

type ArgumentArray struct {
	IsVariadic bool      // Have 3 dots ... in type name, prints without breakets.
	Size       int64     // 0 is a slice.
	Element    *Argument // Array element.
}

ArgumentArray represents array, slice or variadic argument.

type ArgumentChan

type ArgumentChan struct {
	Direction types.ChanDir // Channel direction: 'chan', '<-chan', 'chan<-'.
	Element   *Argument     // Passed element of the channel.
}

ArgumentChan represents channel type argument.

type ArgumentInterface

type ArgumentInterface struct {
	Methods []*Method // Methods list of the interface.
}

ArgumentInterface represents anonymous interface as argument.

type ArgumentMap

type ArgumentMap struct {
	Key   *Argument
	Value *Argument
}

ArgumentMap represents map type argument.

type ArgumentPointer

type ArgumentPointer struct {
	Element *Argument // Argument of the pointer, can be simpe struct or slice and etc.
}

ArgumentPointer represents an pointer type argument.

type ArgumentStruct

type ArgumentStruct struct {
	Fields []*ArgumentStructField // Struct's field list.
}

ArgumentStruct represents anonymous struct as argument.

type ArgumentStructField

type ArgumentStructField struct {
	Name string    // Name of the field, can be empty.
	Tag  string    // Tag of the field, can be empty.
	Type *Argument // Type of the field, can be with package.
}

ArgumentStructField represents field of the stuct.

type Interface

type Interface struct {
	Name        string    // Name of the interface.
	PackageName string    // Name of the package with interface.
	ImportPath  string    // Import path to the package with interface.
	DirPath     string    // Absolute path to directory with interface.
	Methods     []*Method // Methods list of the interface.
}

Interface describes the interface found by the analyzer.

type Method

type Method struct {
	Name       string      // Name of the method.
	IsVariadic bool        // Params of the method have a variadic argument.
	Params     []*Argument // Input arguments of the methods.
	Results    []*Argument // Result arguments if the methods.
}

Method describes mehtod of the interface.

Jump to

Keyboard shortcuts

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