Documentation
¶
Index ¶
- type Client
- func (c *Client) Delete(ctx context.Context, path string, body interface{}) (int, []byte, error)
- func (c *Client) DeleteWithResult(ctx context.Context, path string, body interface{}, result interface{}) (int, error)
- func (c *Client) Get(ctx context.Context, path string) (int, []byte, error)
- func (c *Client) GetWithResult(ctx context.Context, path string, result interface{}) (int, error)
- func (c *Client) NextAddress(ctx context.Context) (string, error)
- func (c *Client) Post(ctx context.Context, path string, body interface{}) (int, []byte, error)
- func (c *Client) PostWithResult(ctx context.Context, path string, body interface{}, result interface{}) (int, error)
- func (c *Client) Put(ctx context.Context, path string, body interface{}) (int, []byte, error)
- func (c *Client) PutWithResult(ctx context.Context, path string, body interface{}, result interface{}) (int, error)
- type ClientOption
- type Server
- type ServerOption
- func WithAddress(addr string) ServerOption
- func WithClientEnableTracing(enableTracing bool) ServerOption
- func WithDebugMode() ServerOption
- func WithDefaultHealthCheck(enable bool) ServerOption
- func WithEnTransNames() ServerOption
- func WithEnableMetrics(enable bool) ServerOption
- func WithEnableProfiling(enable bool) ServerOption
- func WithEnableSocketIoServer(enableSocketIoServer bool) ServerOption
- func WithMiddlewares(middlewares ...gin.HandlerFunc) ServerOption
- func WithReleaseMode() ServerOption
- func WithSocketIoServer(socketIoServer *socketio.Server) ServerOption
- func WithTLSConfig(certFile, keyFile string) ServerOption
- func WithTestMode() ServerOption
- func WithTransName(transName string) ServerOption
- func WithZhTransNames() ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewDefaultClient ¶
func NewDefaultClient(serverName string, endpoint string, opts ...ClientOption) *Client
func (*Client) DeleteWithResult ¶
func (*Client) GetWithResult ¶
func (*Client) PostWithResult ¶
type ClientOption ¶
type ClientOption func(c *Client)
func WithClientBalancer ¶
func WithClientBalancer(b registry.Balancer) ClientOption
WithClientBalancer 设置负载均衡
func WithClientDiscovery ¶
func WithClientDiscovery(d registry.Discovery) ClientOption
WithClientDiscovery 设置服务发现
func WithClientResolver ¶
func WithClientResolver(r registry.Resolver) ClientOption
WithClientResolver 设置服务解析
func WithRestyClientFunc ¶
func WithRestyClientFunc(f func() *resty.Client) ClientOption
WithRestyClientFunc 设置获取resty的client的函数
type Server ¶
Server wrapper for gin.Engine
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
func (*Server) RegistryWebsocket ¶
func (*Server) SocketIoServer ¶
func (*Server) Translator ¶
func (s *Server) Translator() ut.Translator
type ServerOption ¶
type ServerOption func(*Server)
func WithAddress ¶
func WithAddress(addr string) ServerOption
func WithClientEnableTracing ¶
func WithClientEnableTracing(enableTracing bool) ServerOption
WithClientEnableTracing 设置是否开启链路追踪
func WithDebugMode ¶
func WithDebugMode() ServerOption
func WithDefaultHealthCheck ¶
func WithDefaultHealthCheck(enable bool) ServerOption
func WithEnTransNames ¶
func WithEnTransNames() ServerOption
func WithEnableMetrics ¶
func WithEnableMetrics(enable bool) ServerOption
func WithEnableProfiling ¶
func WithEnableProfiling(enable bool) ServerOption
func WithEnableSocketIoServer ¶
func WithEnableSocketIoServer(enableSocketIoServer bool) ServerOption
func WithMiddlewares ¶
func WithMiddlewares(middlewares ...gin.HandlerFunc) ServerOption
func WithReleaseMode ¶
func WithReleaseMode() ServerOption
func WithSocketIoServer ¶
func WithSocketIoServer(socketIoServer *socketio.Server) ServerOption
func WithTLSConfig ¶
func WithTLSConfig(certFile, keyFile string) ServerOption
WithTLSConfig with TLS config.
func WithTestMode ¶
func WithTestMode() ServerOption
func WithTransName ¶
func WithTransName(transName string) ServerOption
func WithZhTransNames ¶
func WithZhTransNames() ServerOption
Click to show internal directories.
Click to hide internal directories.