generator

package
v2.0.0-...-5e4c55b Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package generator

Package generator

Package generator

Index

Constants

View Source
const (
	FuncCreateOrUpdate = "CreateOrUpdate"
	FuncGet            = "Get"
	FuncDelete         = "Delete"
	FuncListByRG       = "ListByRG"
	FuncList           = "List"
)
View Source
const CreateOrUpdateFuncTemplateRaw = `` /* 515-byte string literal not displayed */
View Source
const DeleteFuncTemplateRaw = `` /* 283-byte string literal not displayed */
View Source
const GetFuncTemplateRaw = `` /* 566-byte string literal not displayed */
View Source
const ListByRGFuncTemplateRaw = `` /* 452-byte string literal not displayed */
View Source
const ListFuncTemplateRaw = `` /* 437-byte string literal not displayed */

Variables

View Source
var ClientFactoryTemplate = template.Must(template.New("object-scaffolding-factory").Parse(`
func New(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (Interface, error) {
	if options == nil {
		options = utils.GetDefaultOption("{{.APIVersion}}")
	}

	client, err := {{.PackageAlias}}.New{{.ClientName}}(subscriptionID, credential, options)
	if err != nil {
		return nil, err
	}
	return &Client{client}, nil
}
`))
View Source
var ClientTemplate = template.Must(template.New("object-scaffolding-client-struct").Parse(`
type Client struct{
	*{{.PackageAlias}}.{{.ClientName}}
}
`))
View Source
var CreateOrUpdateFuncTemplate = template.Must(template.New("object-scaffolding-create-func").Parse(CreateOrUpdateFuncTemplateRaw))
View Source
var DeleteFuncTemplate = template.Must(template.New("object-scaffolding-delete-func").Parse(DeleteFuncTemplateRaw))
View Source
var GetFuncTemplate = template.Must(template.New("object-scaffolding-get-func").Parse(GetFuncTemplateRaw))
View Source
var ImportTemplate = template.Must(template.New("import").Parse(`{{.Alias}} "{{.Package}}"
`))
View Source
var ListByRGFuncTemplate = template.Must(template.New("object-scaffolding-list-func").Parse(ListByRGFuncTemplateRaw))
View Source
var ListFuncTemplate = template.Must(template.New("object-scaffolding-list-func").Parse(ListFuncTemplateRaw))

Functions

This section is empty.

Types

type ClientGenConfig

type ClientGenConfig struct {
	Verbs        []string
	Resource     string
	PackageName  string
	PackageAlias string
	ClientName   string
	APIVersion   string `marker:"apiVersion,optional"`
	Expand       bool   `marker:"expand,optional"`
}

type Generator

type Generator struct {
	// HeaderFile specifies the header text (e.g. license) to prepend to generated files.
	HeaderFile string `marker:",optional"`
}

+controllertools:marker:generateHelp Generator generates client code for azure services.

func (Generator) CheckFilter

func (Generator) CheckFilter() loader.NodeFilter

func (Generator) Generate

func (g Generator) Generate(ctx *genall.GenerationContext) error

func (Generator) RegisterMarkers

func (Generator) RegisterMarkers(into *markers.Registry) error

type ImportStatement

type ImportStatement struct {
	Alias   string
	Package string
}

Jump to

Keyboard shortcuts

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