svc

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Svc

type Svc struct {
	Handler      bool
	Client       string
	Omitempty    bool
	Doc          bool
	Jsonattrcase string

	DocPath string

	Env       string
	ClientPkg string

	RoutePatternStrategy int

	ModName string
	// contains filtered or unexported fields
}

Svc wraps all config properties for commands

func NewMockSvc added in v0.7.7

func NewMockSvc(dir string) Svc

NewMockSvc new Svc instance for unit test purpose

func NewSvc added in v0.7.7

func NewSvc(dir string) Svc

NewSvc new Svc instance

func (Svc) Deploy added in v0.3.0

func (receiver Svc) Deploy(k8sfile string)

Deploy deploys project to kubernetes. If k8sfile flag not set, it will be deployed as statefulset kind using statefulset.yaml file in the project root, so if you want to deploy a monolithic project, please set k8sfile flag.

func (Svc) GenClient added in v0.3.7

func (receiver Svc) GenClient()

GenClient generates http client code from OpenAPI3.0 description json file, only support Golang currently.

func (Svc) Http

func (receiver Svc) Http()

Http generates main function, config files, db connection function, http routes, http handlers, service interface and service implementation from the result of ast parsing svc.go file in the project root. It may panic if validation failed

func (Svc) Init

func (receiver Svc) Init()

Init inits a project

func (Svc) Push added in v0.3.2

func (receiver Svc) Push(repo string)

Push executes go mod vendor command first, then build docker image and push to remote image repository It also generates deployment kind(for monolithic) and statefulset kind(for microservice) yaml files for kubernetes deploy, if these files already exist, it will only change the image version in each file, so you can edit these files manually to fit your need.

func (Svc) Run added in v0.5.0

func (receiver Svc) Run(watch bool)

Run runs the project locally. Recommend to set watch flag to enable watch mode for rapid development.

func (Svc) Shutdown added in v0.3.2

func (receiver Svc) Shutdown(k8sfile string)

Shutdown stops and removes the project from kubernetes. If k8sfile flag not set, it will use statefulset.yaml file in the project root, so if you had already set k8sfile flag when you deploy the project, you should set the same k8sfile flag.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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