Documentation ¶
Index ¶
- func GenTemplate(path string, force bool) error
- func GetTemplate(t template.Template) string
- func WriteTemplate(path string, force bool) error
- type File
- type Generator
- type Option
- func ContainerTag(r string) Option
- func ContainerVersion(r string) Option
- func Directory(d string) Option
- func Mesh(r string) Option
- func Namespace(r string) Option
- func Port(r string) Option
- func RegistryPrefix(r string) Option
- func Replica(r int) Option
- func Service(s string) Option
- func Vendor(v string) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenTemplate ¶
func GetTemplate ¶
GetTemplate search template in config dir,ordered by: current dir > .template > ../.template > ~/.template > default
func WriteTemplate ¶
WriteTemplate Write Template to dir ,so user can edit
Types ¶
type File ¶
type File struct { // Path specifies where the file will reside. Path string // Template is the template used to generate the file. Template string }
File represents a file to generate.
type Generator ¶
Generator is the interface that generates project template files.
Generate accepts a list of files and generates them based on their template.
type Option ¶
type Option func(o *Options)
Option manipulates the Options passed.
func ContainerTag ¶
func ContainerVersion ¶
func RegistryPrefix ¶
type Options ¶
type Options struct { // Service is the name of the service the generator will generate files // for. Service string // Vendor is the service vendor. Vendor string // Directory is the directory where the files will be generated to. Directory string //ContainerTag is the container's tag ContainerTag string // Version is the version of the container Version string // Port of your service Port string // Namespace in your k8s cluster Namespace string //RegistryPrefix eg: gcr.io/username/repo RegistryPrefix string //Mesh service mesh name eg:istio Mesh string //Replica number of ReplicaSet Replica int }
Options represents the options for the generator.
Click to show internal directories.
Click to hide internal directories.