cmd

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebServerAddr = "GAPI_ADDR"

	GinUse = "gin"
)
View Source
const CtlUse = "ctl"
View Source
const (
	GrpcUse = "grpc"
)
View Source
const (
	HealthProjectName = "healthx"
)

Variables

View Source
var (
	DefaultGrpcUse = "grpc"
	DefaultShort   = "Run grpc server"
)

Functions

func GetCtlLivenessCmd

func GetCtlLivenessCmd() *cobra.Command

func GetCtlReadinessCmd

func GetCtlReadinessCmd() *cobra.Command

func GetCtlStartupCmd

func GetCtlStartupCmd() *cobra.Command

func GetGrpcLivenessCmd

func GetGrpcLivenessCmd() *cobra.Command

func GetGrpcReadinessCmd

func GetGrpcReadinessCmd() *cobra.Command

func GetGrpcStartupCmd

func GetGrpcStartupCmd() *cobra.Command

func GetHttpLivenessCmd

func GetHttpLivenessCmd() *cobra.Command

func GetHttpReadinessCmd

func GetHttpReadinessCmd() *cobra.Command

func GetHttpStartupCmd

func GetHttpStartupCmd() *cobra.Command

func NewCtlCommand

func NewCtlCommand() *ctl

func NewGinCommand

func NewGinCommand() *ginCommand

func NewGrpcCmd

func NewGrpcCmd(opts ...GrpcOptFunc) *grpcCmd

NewGrpcCmd new grpcCmd

func NewHealthCmd

func NewHealthCmd(use string) *healthCmd

Types

type Commander

type Commander interface {
	GetCmd() *cobra.Command
	GetShutdownFunc() StopFunc
	RegShutdownFunc(stopSteps ...StopStep)
}

type GrpcOptFunc

type GrpcOptFunc func(*GrpcOptions)

GrpcOptFunc set GrpcOptions fileds

func WithCfg

func WithCfg(cfg server.Cfg) GrpcOptFunc

WithCfg set Cfg filed

func WithGrpcServerOpt

func WithGrpcServerOpt(serverOpts ...grpc.ServerOption) GrpcOptFunc

WithGrpcServerOpt set ServerOpts filed

type GrpcOptions

type GrpcOptions struct {
	Cfg        server.Cfg
	ServerOpts []grpc.ServerOption
	// contains filtered or unexported fields
}

GrpcOptions grpc options

type Priority

type Priority = int

type StopFunc

type StopFunc func()

type StopStep

type StopStep struct {
	StopFn   StopFunc
	StepName string
}

Jump to

Keyboard shortcuts

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