crgen

package
v0.0.0-...-d46a6ae Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CRGen = &cobra.Command{
	Use:   "crgen",
	Short: "Handler for generate CR yaml for oam.workloadtype or oam.trait for kubebuilder",
	Long:  "Handler for generate CR yaml for oam.workloadtype or oam.trait for kubebuilder",
	Run: func(cmd *cobra.Command, args []string) {
		if err := gen.Run(); err != nil {
			logger.Error(err, "gen.Run")
			os.Exit(1)
		}
	},
}
View Source
var (
	ParameterTypeMap = map[string]oamv1alpha1.ParameterType{
		"boolean": oamv1alpha1.Boolean,
		"string":  oamv1alpha1.String,
		"integer": oamv1alpha1.Number,
	}
)

Functions

This section is empty.

Types

type File

type File struct {
	Name    string
	Content []byte
}

type Generator

type Generator struct {
	Path   string
	OAM    string
	Output string
	// contains filtered or unexported fields
}

func (*Generator) Run

func (g *Generator) Run() error

func (*Generator) Validate

func (g *Generator) Validate() error

func (*Generator) Walk

func (g *Generator) Walk(p *project.OAMProject) ([]*File, error)

type Parser

type Parser struct {
	*crd.Parser

	Roots []*loader.Package
	Path  string
}

func NewParser

func NewParser(p string) (*Parser, error)

func (*Parser) Load

func (p *Parser) Load() (map[string]*apiext.JSONSchemaProps, error)

type Walker

type Walker func(p *project.OAMProject) ([]*File, error)

Jump to

Keyboard shortcuts

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