generator

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamPaths                        = `paths`
	ParamPathsSourceRelative          = `source_relative`
	ParamEmbedSwagger                 = `embed_swagger`
	ParamChaincodeMethodServicePrefix = `service_name_method_prefix`
	ParamServiceChaincodeResolver     = `service_resolver`
)

Variables

View Source
var (
	ErrNoTargetService = errors.New("no target service defined in the file")
)

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Opts Opts
	// contains filtered or unexported fields
}

func New

func New(reg *descriptor.Registry) *Generator

New returns a new generator which generates handler wrappers.

func (*Generator) Generate

func (g *Generator) Generate(targets []*descriptor.File) ([]*plugin.CodeGeneratorResponse_File, error)

type Opts

type Opts struct {
	PathsSourceRelative          bool
	EmbedSwagger                 bool // generate var with embed annotation to include generated swagger fie
	ChaincodeMethodServicePrefix bool // add prefix with service name to chaincode methdod
	ServiceChaincodeResolver     bool
}

Opts by default all opts are disabled

func OptsFromParams

func OptsFromParams(params string) Opts

type TemplateParams

type TemplateParams struct {
	*descriptor.File
	Imports []descriptor.GoPackage
	Opts    Opts
}

Jump to

Keyboard shortcuts

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