codegen

package
v0.0.0-...-ad3f877 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Create three types of Go modules 1. Simple Go Module with a main 2. Go module with scafolding to deploy to Cloud Run 3. A Go module with API (gRPC) support

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiType

type ApiType struct {
	Parentfolder string `default:"api"`
	// name of the API
	Name string `default:"user"`
	// API version
	Version string `default:"v1alpha1"`
	// Location for the generated code. Relative to parent
	CodeGenLocation string `default:"gen/proto/go"`
}

type BufGenYamlStructure

type BufGenYamlStructure struct {
	Filename string `default:"buf.gen.yaml"`
}

type BufWorkYamlStructure

type BufWorkYamlStructure struct {
	Filename string `default:"buf.work.yaml"`
}

type BufYamlStructure

type BufYamlStructure struct {
	Filename string `default:"buf.yaml"`
}

type CmdStructure

type CmdStructure struct {
	Foldername string `default:"cmd"`
}

type DockerStructure

type DockerStructure struct {
	Filename string `default:"Dockerfile"`
}

type FSType

type FSType string
const (
	File   FSType = "FILE"
	Folder        = "FOLDER"
)

type InternalStructure

type InternalStructure struct {
	Foldername string `default:"internal"`
}

type MakefileStructure

type MakefileStructure struct {
	Filename string `default:"Makefile"`
}

type OutPutStructure

type OutPutStructure struct {
	Foldername string `default:"bin"`
	Binaryname string
}

type PkgStructure

type PkgStructure struct {
	Foldername string `default:"pkg"`
}

type ProjectStructure

type ProjectStructure struct {
	Projectname              string
	FullyQualifiedModuleName string
	Api                      ApiType
	BufYaml                  BufYamlStructure
	User                     UserGoStructure
	Out                      OutPutStructure
	Cmd                      CmdStructure
	Pkg                      PkgStructure
	Internal                 InternalStructure
	ServerGo                 ServerGoStructure
	ServerTestGo             ServerTestGoStructure
	Make                     MakefileStructure
	ReadMe                   ReadmeStructure
	Dockerfile               DockerStructure
	BufGenYaml               BufGenYamlStructure
	BufWorkYaml              BufWorkYamlStructure
}

func NewCloudRunGoModule

func NewCloudRunGoModule(moduleName string, fullyQualifiedModuleName string, outputDir string) ProjectStructure

func NewGRPCGoModule

func NewGRPCGoModule(moduleName string, fullyQualifiedModuleName string, outputDir string) ProjectStructure

func NewSimpleGoModule

func NewSimpleGoModule(moduleName string, fullyQualifiedModuleName string, outputDir string) ProjectStructure

Create a go module with the given name moduleName: the name of the go module fullyQualifiedModuleName: fully qualified name for the module outputDir: Output folder

type ReadmeStructure

type ReadmeStructure struct {
	Filename string `default:"README.md"`
}

type ServerGoStructure

type ServerGoStructure struct {
	Filename string `default:"server.go"`
}

type ServerTestGoStructure

type ServerTestGoStructure struct {
	Filename string `default:"server_test.go"`
}

type UserGoStructure

type UserGoStructure struct {
	Filename string `default:"user.proto"`
}

Jump to

Keyboard shortcuts

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