annotation

package
v0.0.0-...-3e473ad Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAnnotation = errors.New("not a valid Annotation")

Functions

This section is empty.

Types

type Annotation

type Annotation string
@Enum {
	Singleton
	Factory
}
const (
	// AnnotationSingleton is an Annotation of type Singleton.
	AnnotationSingleton Annotation = "Singleton"
	// AnnotationFactory is an Annotation of type Factory.
	AnnotationFactory Annotation = "Factory"
)

func ParseAnnotation

func ParseAnnotation(value string) (Annotation, error)

ParseAnnotation converts a string to an Annotation.

func (Annotation) IsValid

func (x Annotation) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Annotation) Name

func (x Annotation) Name() string

Name is the attribute of Annotation.

func (Annotation) String

func (x Annotation) String() string

String implements the Stringer interface.

func (Annotation) Val

func (x Annotation) Val() string

Val is the attribute of Annotation.

type Factory

type Factory struct {
	Params []string
	// contains filtered or unexported fields
}

type PluginFactory

type PluginFactory struct{}

@Singleton

func (*PluginFactory) Annotations

func (f *PluginFactory) Annotations() map[string][]api.AnnotationType

func (*PluginFactory) New

func (f *PluginFactory) New(typedAnnotations []*api.TypedAnnotation) (api.Generator, error)

func (*PluginFactory) Order

func (f *PluginFactory) Order() api.Order

type PluginGenerator

type PluginGenerator struct {
	// contains filtered or unexported fields
}

func (*PluginGenerator) GetImports

func (g *PluginGenerator) GetImports() []string

func (*PluginGenerator) WriteBody

func (g *PluginGenerator) WriteBody(wr io.Writer) error

func (*PluginGenerator) WriteConst

func (g *PluginGenerator) WriteConst(wr io.Writer) error

func (*PluginGenerator) WriteInitFunc

func (g *PluginGenerator) WriteInitFunc(wr io.Writer) error

type Singleton

type Singleton struct {
	Name           string
	NamedOnly      bool   `value:"false"`
	UseConstructor bool   `value:"false"`
	LazyInit       bool   `value:"true"`
	LocalVar       bool   `value:"false"`
	LocalGetter    bool   `value:"false"`
	LocalPrefix    string `value:"__"`
	InitMethod     string
	Init           []string
	// contains filtered or unexported fields
}

func (*Singleton) SetLocalGetter

func (s *Singleton) SetLocalGetter(localGetter bool)

func (*Singleton) SetLocalVar

func (s *Singleton) SetLocalVar(localVar bool)

func (*Singleton) WriteString

func (s *Singleton) WriteString(buf io.StringWriter) error

Jump to

Keyboard shortcuts

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