aspect

package
v0.0.0-...-f6bedb9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advice

type Advice interface {
	Nameable
	Func() *ast.FuncDecl
}

Advice

func NewAdvice

func NewAdvice(opts ...Option[advice]) Advice

type Aspect

type Aspect interface {
	Nameable
	SetBefore(Advice)
	SetAfter(Advice)
	SetAround(Advice)
	GetBefore() Advice
	GetAfter() Advice
	GetAround() Advice
	Imports() []*ast.ImportSpec
}

Aspect

func NewAspect

func NewAspect(opts ...Option[aspect]) Aspect

type Cloneable

type Cloneable[T any] interface {
	Clone() T
}

type Component

type Component interface {
	Nameable
	// Fields() []Component
	PkgPath() string
	PkgName() string
	Factory() (string, string, string)
}

Component

func NewComponent

func NewComponent(opts ...Option[component]) Component

type Cutable

type Cutable interface {
	SetPointcuts(po ...Pointcut)
	GetPointcuts() []Pointcut
}

type Field

type Field interface {
	Nameable
	Cloneable[field]
	Type() string
	TPkg() string
	Define() string
	Inject() string
	Assign() string
	Docs() *ast.CommentGroup
}

Field

func NewField

func NewField(opts ...FieldOption) Field

type FieldOption

type FieldOption Option[field]

func WithFieldAssign

func WithFieldAssign(assign string) FieldOption

func WithFieldDoc

func WithFieldDoc(doc *ast.CommentGroup) FieldOption

func WithFieldInject

func WithFieldInject(name string) FieldOption

func WithFieldName

func WithFieldName(name string) FieldOption

func WithFieldType

func WithFieldType(pkg, name string) FieldOption

type Joinpoint

type Joinpoint interface {
	Nameable
	ParamTo(i int) any
	Params() []any
	Results() []any
	ResultTo(i int) any
	FuncName() string
}

Joinpoint

type Method

type Method interface {
	Nameable
	Cutable
	Cloneable[method]
	GetParams() ([]string, []string)
	GetResults() ([]string, []string)
}

Method

func NewMethod

func NewMethod(opts ...MethodOption) Method

type MethodOption

type MethodOption Option[method]

func WithMethodDecl

func WithMethodDecl(decl *ast.FuncDecl) MethodOption

func WithMethodName

func WithMethodName(name string) MethodOption

func WithMethodParams

func WithMethodParams(params *ast.FieldList) MethodOption

func WithMethodResults

func WithMethodResults(results *ast.FieldList) MethodOption

type Nameable

type Nameable interface {
	Name() string
}

type Option

type Option[T any] func(*T)

func WithAdviceDecl

func WithAdviceDecl(decl *ast.FuncDecl) Option[advice]

func WithAdviceName

func WithAdviceName(name string) Option[advice]

func WithAspectImports

func WithAspectImports(specs []*ast.ImportSpec) Option[aspect]

func WithAspectName

func WithAspectName(name string) Option[aspect]

func WithComponentFactory

func WithComponentFactory(pkg, name string) Option[component]

func WithComponentName

func WithComponentName(name string) Option[component]

func WithComponentPkg

func WithComponentPkg(path, name string) Option[component]

type Pointcut

type Pointcut interface {
	Nameable
}

Pointcut

func NewPointcut

func NewPointcut(opts ...PointcutOption) Pointcut

type PointcutOption

type PointcutOption Option[pointcut]

func WithPointcutName

func WithPointcutName(name string) PointcutOption

type ProceedingJoinpoint

type ProceedingJoinpoint interface {
	Joinpoint
	Proceed(...any) []any
}

ProceedingJoinpoint

type Proxy

type Proxy interface {
	Nameable
	Cutable
	Cloneable[proxy]
	SetMethods(m ...Method)
	GetMethods() []Method
	PkgPath() string
	PkgName() string
	Imports() []*ast.ImportSpec
	Docs() *ast.CommentGroup
	Abstract() string
	Suffix() string
	AddFields(c ...Field)
	Fields() []Field
	Option() string
	IsSingleton() bool
}

Proxy

func NewProxy

func NewProxy(opts ...ProxyOption) Proxy

type ProxyOption

type ProxyOption Option[proxy]

func WithProxyAbstract

func WithProxyAbstract(abs string) ProxyOption

func WithProxyDoc

func WithProxyDoc(doc *ast.CommentGroup) ProxyOption

func WithProxyImports

func WithProxyImports(specs []*ast.ImportSpec) ProxyOption

func WithProxyMode

func WithProxyMode(s bool) ProxyOption

func WithProxyName

func WithProxyName(name string) ProxyOption

func WithProxyOption

func WithProxyOption(opt string) ProxyOption

func WithProxyPkg

func WithProxyPkg(path, name string) ProxyOption

func WithProxyPointcuts

func WithProxyPointcuts(po ...Pointcut) ProxyOption

func WithProxySuffix

func WithProxySuffix(suf string) ProxyOption

Jump to

Keyboard shortcuts

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