codegen

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHTTPHandlerProviders

func BuildHTTPHandlerProviders(opts *PipelineOptions) (err error)

func BuildMiddlewareProvider

func BuildMiddlewareProvider(opts *PipelineOptions) (err error)

func BuildOpenAPISpec

func BuildOpenAPISpec(opts *PipelineOptions) (err error)

func BuildServiceHTTPHandlerFactories

func BuildServiceHTTPHandlerFactories(
	opts *PipelineOptions,
) (err error)

func BuildWireSet

func BuildWireSet(opts *PipelineOptions) (err error)

func BuildWorkerProviders

func BuildWorkerProviders(opts *PipelineOptions) (err error)

func BuildWorkerProxies

func BuildWorkerProxies(
	opts *PipelineOptions,
) (err error)

func Generate

func Generate(params GenerateParams) (err error)

Types

type DTOType

type DTOType string
const (
	DTOTypeRequest  DTOType = "request"
	DTOTypeResponse DTOType = "response"
)

type FilePath

type FilePath string

type FileSet

type FileSet map[FilePath]*jen.File

func NewFileSet

func NewFileSet() FileSet

func (FileSet) Get

func (fs FileSet) Get(filePath FilePath, packageName PackageName) (f *jen.File)

func (FileSet) NewFile

func (fs FileSet) NewFile(filePath FilePath, packageName PackageName) *jen.File

type GenerateParams

type GenerateParams struct {
	Dir       string
	Pipeline  Pipeline
	Patterns  []string
	OutputDir string
}

type PackageName

type PackageName string

type Pipeline

type Pipeline []PipelineFunc

func DefaultPipeline

func DefaultPipeline() Pipeline

type PipelineFunc

type PipelineFunc func(opts *PipelineOptions) (err error)

type PipelineOptions

type PipelineOptions struct {
	FileSet        FileSet
	GenerateParams GenerateParams
	Services       []*parser.Service
	Workers        []*parser.Worker
	Providers      []*parser.Provider
	Middleware     []*parser.Middleware
}

func NewPipelineOptions

func NewPipelineOptions(
	fset FileSet,
	genParams GenerateParams,
	pkgList map[parser.PackagePath]*parser.Package,
) (opts *PipelineOptions)

type TagOption

type TagOption struct {
	Name  string
	Value string
}

type TagOptions

type TagOptions []TagOption

func (TagOptions) Get

func (t TagOptions) Get(name string) (to TagOption, ok bool)

func (TagOptions) GetErr

func (t TagOptions) GetErr(name string) (TagOption, error)

func (TagOptions) Has

func (t TagOptions) Has(name string) bool

Jump to

Keyboard shortcuts

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