model

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

internal/model/constants.go

Index

Constants

View Source
const (
	DiPkgPath = "github.com/shanjunmei/dig"
	TagBuild  = "digen"
)

Variables

This section is empty.

Functions

func FullFuncName

func FullFuncName(pkgAlias, funcName string) string

fullFuncName 返回 包别名.函数名

Types

type Arg

type Arg struct {
	Name       string // 参数变量名
	IsConst    bool   // 是否常量
	ConstValue string // 常量字面值(若 IsConst 为 true)
	IsContext  bool   // 是否 context.Context
}

type GenTarget

type GenTarget struct {
	FuncName string
	Node     *ast.FuncDecl
	File     string
}

type Node

type Node struct {
	Name      string
	Func      string
	FuncPkg   string
	RetType   string
	Args      []Arg
	IsInvoke  bool
	IsSupply  bool
	Value     string
	HasError  bool
	IsClosure bool

	ClosureDef string
	UsedPkgs   []string
	PkgPath    string

	GenericArgs string

	Comment string
}

func (Node) LongName

func (node Node) LongName() string

LongName 返回用于日志的完整路径(包路径.函数名)

func (Node) ShortName

func (node Node) ShortName() string

ShortName 返回用于调用的简短名称(包别名.函数名)

type UnusedMode

type UnusedMode int
const (
	UnusedModeError UnusedMode = iota
	UnusedModeIgnore
	UnusedModeDrop
)

Jump to

Keyboard shortcuts

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