model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MockPackageSuffix = "_mock"
	MockDir           = "mocks"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Ident

type Ident struct {
	Name string
	Type string
}

type IdentList

type IdentList []Ident

func (IdentList) IdentString

func (i IdentList) IdentString(identPrefix IdentType, resolveLambda bool) (res string)

func (IdentList) IdentWithTypeString

func (i IdentList) IdentWithTypeString(identPrefix IdentType) (res string)

func (IdentList) IdentWithTypeStringAndPrefix

func (i IdentList) IdentWithTypeStringAndPrefix(identPrefix IdentType, prefix string) (res string)

func (IdentList) TypeString

func (i IdentList) TypeString(identPrefix IdentType) (res string)

type IdentType

type IdentType string
const (
	IdentTypeInput  IdentType = "i"
	IdentTypeResult IdentType = "r"
)

type Import

type Import struct {
	Name string
	Path string
}

func ImportFromAst

func ImportFromAst(spec *ast.ImportSpec) Import

func (Import) ImportName

func (i Import) ImportName() string

func (Import) String

func (i Import) String() string

type InterfaceResult

type InterfaceResult struct {
	Name        string
	PackageName string
	Imports     []Import
	Methods     []Method
	Types       TypesList
}

func (InterfaceResult) ValidateReadyForGenerate

func (ir InterfaceResult) ValidateReadyForGenerate() error

ValidateReadyForGenerate that all members are set and valid

type Method

type Method struct {
	Name       string
	TypeParams IdentList
	Params     IdentList
	Results    IdentList
}

func (Method) Signature

func (m Method) Signature() string

func (Method) SignatureWithoutIdentifier

func (m Method) SignatureWithoutIdentifier() string

type Reference

type Reference struct {
	PackageID string // Empty if part of this package
	Name      string // Name of referenced object
}

type TypesList

type TypesList []Ident

func (TypesList) ListIdentifier

func (tl TypesList) ListIdentifier() (res string)

func (TypesList) ListTypesWithIdentifiers

func (tl TypesList) ListTypesWithIdentifiers() (res string)

Jump to

Keyboard shortcuts

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