rpc

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const Type string = "rpc"

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option 参数设置类型

func Log added in v0.1.15

func Log(opts ...log.ServerOption) Option

Log 设置日志配置

func WithConfig

func WithConfig(config config.Config) Option

WithStartedHook 设置启动回调函数

func WithEndHook added in v0.1.1

func WithEndHook(f engine.Hook) Option

func WithServiceName added in v0.1.1

func WithServiceName(serviceName string) Option

WithServiceName 设置服务名称

func WithStartedHook added in v0.1.1

func WithStartedHook(f engine.Hook) Option

WithStartedHook 设置启动回调函数

type Server

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

func New

func New(name string, opts ...Option) *Server

New 实例化

func (*Server) Attempt

func (e *Server) Attempt() bool

Attempt 判断是否可以启动

func (*Server) Config

func (e *Server) Config(cfg config.Config)

func (*Server) Endpoint

func (e *Server) Endpoint() *url.URL

func (*Server) Group

func (e *Server) Group(group string, middlewares ...middleware.Middleware) *engine.RouterGroup

func (*Server) Handle

func (e *Server) Handle(path string, obj interface{})

func (*Server) Name

func (e *Server) Name() string

func (*Server) Options

func (e *Server) Options(opts ...Option)

Options 设置参数

func (*Server) ServiceName added in v0.1.1

func (s *Server) ServiceName() string

ServiceName 服务名称

func (*Server) Start

func (e *Server) Start(ctx context.Context) (err error)

Start 开始

func (*Server) Stop

func (e *Server) Stop(ctx context.Context) error

Shutdown 停止

func (*Server) Type

func (e *Server) Type() string

func (*Server) Use

func (e *Server) Use(middlewares ...middleware.Middleware)

Jump to

Keyboard shortcuts

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