models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

This file may have been modified by Bytedance Ltd. and/or its affiliates (“Bytedance's Modifications”). All Bytedance's Modifications are Copyright (2022) Bytedance Ltd. and/or its affiliates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expression

type Expression struct {
	Value       string
	IsStar      bool
	IsVariadic  bool
	IsInterface bool
	IsWriter    bool
	Underlying  string
	PkgPath     string // 如果map结构,那么PkgPath表示的是key的包路径
	PkgName     string
}

func (*Expression) String

func (e *Expression) String() string

type Field

type Field struct {
	Name  string
	Type  *Expression
	Index int
}

func (*Field) FieldMaxIndex

func (f *Field) FieldMaxIndex() int

func (*Field) IsBasicType

func (f *Field) IsBasicType() bool

func (*Field) IsNamed

func (f *Field) IsNamed() bool

func (*Field) IsStruct

func (f *Field) IsStruct() bool

func (*Field) IsWriter

func (f *Field) IsWriter() bool

func (*Field) ShortName

func (f *Field) ShortName() string

func (*Field) ToStringForStruct

func (f *Field) ToStringForStruct() string

type Function

type Function struct {
	Name             string
	IsExported       bool
	Receiver         *Receiver
	Parameters       []*Field
	Results          []*Field
	RowData          string
	ReturnsError     bool
	ContainAnonFuncs int
}

func (*Function) AnonFuncsCount

func (f *Function) AnonFuncsCount() int

func (*Function) FullName

func (f *Function) FullName() string

func (*Function) IsNaked

func (f *Function) IsNaked() bool

func (*Function) OnlyReturnsError

func (f *Function) OnlyReturnsError() bool

func (*Function) OnlyReturnsOneValue

func (f *Function) OnlyReturnsOneValue() bool

func (*Function) ReceiverName

func (f *Function) ReceiverName() string

func (*Function) ReturnsMultiple

func (f *Function) ReturnsMultiple() bool

func (*Function) TestName

func (f *Function) TestName() string

func (*Function) TestParameters

func (f *Function) TestParameters() []*Field

func (*Function) TestResults

func (f *Function) TestResults() []*Field
type Header struct {
	Comments        []string
	Package         string
	Imports         []*Import
	OriginalImports []*Import
	Code            []byte
}

type Import

type Import struct {
	Name, Path string
}

type Path

type Path string

func (Path) IsTestPath

func (p Path) IsTestPath() bool

func (Path) TestPath

func (p Path) TestPath() string

type Receiver

type Receiver struct {
	*Field
	Fields []*Field
}

func (*Receiver) InitiateReceiver

func (r *Receiver) InitiateReceiver() string

func (*Receiver) InitiateReceiverForMock

func (r *Receiver) InitiateReceiverForMock() string

func (*Receiver) InitiateStruct

func (r *Receiver) InitiateStruct() string

func (*Receiver) InitiateVariable

func (r *Receiver) InitiateVariable() string

InitiateVariable used for gotype dynamic transformation

Jump to

Keyboard shortcuts

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