annotation

package
v0.0.0-...-55984ea Latest Latest
Warning

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

Go to latest
Published: Sep 24, 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"`
	LocalGetter     bool   `value:"false"`
	LocalPrefix     string `value:"__"`
	LocalGetterName string
	InitMethod      string
	Init            []string
	// contains filtered or unexported fields
}

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