service

package
v0.0.0-...-e38cb6b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cnt zcontainer.Container, conf *Options, opts ...Option) (err error)

Types

type GoMicroClientWrapGenerateFn

type GoMicroClientWrapGenerateFn func(ng engine.Engine) func(c client.Client) client.Client

type GoMicroHandlerRegisterFn

type GoMicroHandlerRegisterFn func(s server.Server, opts ...server.HandlerOption) error

type GoMicroServerWrapGenerateFn

type GoMicroServerWrapGenerateFn func(ng engine.Engine) func(fn server.HandlerFunc) server.HandlerFunc

type HttpGWHandlerRegisterFn

type HttpGWHandlerRegisterFn func(ctx context.Context, endpoint string, opts []grpc.DialOption) (*runtime.ServeMux, error)

type HttpHandlerRegisterFn

type HttpHandlerRegisterFn func(ctx context.Context, prefix string, ng engine.Engine) (http.Handler, error)

type InitServiceCompleteFn

type InitServiceCompleteFn func(ng engine.Engine)

type LoadEngineFn

type LoadEngineFn func(ng engine.Engine)

type Option

type Option func(o *Options)

func WithGoMicroClientWrapGenerateFnOption

func WithGoMicroClientWrapGenerateFnOption(fn ...GoMicroClientWrapGenerateFn) Option

func WithGoMicroServerWrapGenerateFnOption

func WithGoMicroServerWrapGenerateFnOption(fn ...GoMicroServerWrapGenerateFn) Option

func WithGoMicrohandlerRegisterFnOption

func WithGoMicrohandlerRegisterFnOption(fn GoMicroHandlerRegisterFn) Option

func WithHttpGWhandlerRegisterFnOption

func WithHttpGWhandlerRegisterFnOption(fn HttpGWHandlerRegisterFn) Option

func WithHttpHandlerRegisterFnOption

func WithHttpHandlerRegisterFnOption(fn HttpHandlerRegisterFn) Option

func WithInitServiceCompleteFnOption

func WithInitServiceCompleteFnOption(fn InitServiceCompleteFn) Option

func WithLoadEngineFnOption

func WithLoadEngineFnOption(fn LoadEngineFn) Option

func WithProcessChangeFnOption

func WithProcessChangeFnOption(fn ProcessChangeFn) Option

func WithServiceNameOption

func WithServiceNameOption(s string) Option

func WithSwaggerJSONFileName

func WithSwaggerJSONFileName(s string) Option

type Options

type Options struct {
	ServiceName  string
	ApiPort      int
	ApiInterface string

	Port int

	// 对外部提供访问的地址(注册到服务发现中心),格式[ip:port]
	Advertise string

	Log       string
	LogFormat string
	LogLevel  string

	SwaggerJSONFileName string

	ConfEntryPath string

	GoMicroHandlerRegisterFn GoMicroHandlerRegisterFn

	HttpGWHandlerRegisterFn HttpGWHandlerRegisterFn

	HttpHandlerRegisterFn HttpHandlerRegisterFn

	ProcessChangeFn ProcessChangeFn

	LoadEngineFn          LoadEngineFn
	InitServiceCompleteFn InitServiceCompleteFn

	GoMicroServerWrapGenerateFn []GoMicroServerWrapGenerateFn
	GoMicroClientWrapGenerateFn []GoMicroClientWrapGenerateFn

	Version bool
}

func ParseCommandLine

func ParseCommandLine() (options Options, err error)

ParseCommandLine ...

type ProcessChangeFn

type ProcessChangeFn func(event interface{})

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(options Options, container zcontainer.Container, opts ...Option) *Service

func (*Service) Init

func (s *Service) Init() (err error)

func (*Service) RunServer

func (s *Service) RunServer() (err error)

Jump to

Keyboard shortcuts

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