server

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCRegister

type GRPCRegister func(grpc.ServiceRegistrar)

func GetGRPCRegister

func GetGRPCRegister[T interface{}](register func(grpc.ServiceRegistrar, T), service T) GRPCRegister

type GrpcOption

type GrpcOption struct {
	Port string `json:"port" mapstructure:"port"`
	TLS  bool   `json:"tls" mapstructure:"tls"`
}

func NewGrpcOption

func NewGrpcOption() *GrpcOption

func (GrpcOption) AddFlags

func (o GrpcOption) AddFlags(fs *pflag.FlagSet)

func (GrpcOption) Validate

func (o GrpcOption) Validate() error

type HttpOption

type HttpOption struct {
	Port               string `json:"port" mapstructure:"port"`
	TLS                bool   `json:"tls" mapstructure:"tls"`
	MaxRequestBodySize int    `json:"maxRequestBodySize" mapstructure:"max-request-body-size"`
}

func NewHttpOption

func NewHttpOption() *HttpOption

func (HttpOption) AddFlags

func (o HttpOption) AddFlags(fs *pflag.FlagSet)

func (HttpOption) Validate

func (o HttpOption) Validate() error

type Options

type Options struct {
	Grpc        *GrpcOption `json:"grpc" mapstructure:"grpc"`
	Http        *HttpOption `json:"http" mapstructure:"http"`
	CertFile    string      `json:"certFile" mapstructure:"cert-file"`
	KeyFile     string      `json:"keyFile" mapstructure:"key-file"`
	CaFile      string      `json:"caFile" mapstructure:"ca-file"`
	WomtoolFile string      `json:"womtoolFile" mapstructure:"womtool-file"`
}

Options stands for server options.

func NewOptions

func NewOptions() *Options

func (Options) AddFlags

func (o Options) AddFlags(fs *pflag.FlagSet)

func (Options) Validate

func (o Options) Validate() error

type RouteRegister

type RouteRegister interface {
	AddRoute(route.IRouter)
}

Jump to

Keyboard shortcuts

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