wrapper

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcWrapper

type GrpcWrapper struct {
	ConnKey string // unique key
	*grpc.ClientConn
	context.Context
	// contains filtered or unexported fields
}

func WrapGrpc

func WrapGrpc(ctx context.Context, cc *grpc.ClientConn, connKey string) *GrpcWrapper

func (*GrpcWrapper) Close

func (w *GrpcWrapper) Close() error

func (*GrpcWrapper) Err

func (w *GrpcWrapper) Err() error

func (*GrpcWrapper) Key

func (w *GrpcWrapper) Key() string

type WebsocketWrapper

type WebsocketWrapper struct {
	context.Context
	*websocket.Conn
	UID string
	// contains filtered or unexported fields
}

func WrapWs

func WrapWs(ctx context.Context, c *websocket.Conn, uid string) *WebsocketWrapper

func (*WebsocketWrapper) AddCloseAction

func (w *WebsocketWrapper) AddCloseAction(f func() error)

func (*WebsocketWrapper) AddPingAction

func (w *WebsocketWrapper) AddPingAction(f func() error)

func (*WebsocketWrapper) Close

func (w *WebsocketWrapper) Close() error

func (*WebsocketWrapper) Daemon

func (w *WebsocketWrapper) Daemon()

Daemon is keep read msg from connection, and handle registered ping, pong, close events

func (*WebsocketWrapper) Err

func (w *WebsocketWrapper) Err() error

func (*WebsocketWrapper) Key

func (w *WebsocketWrapper) Key() string

Jump to

Keyboard shortcuts

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