Documentation
¶
Index ¶
- Constants
- func SetOperation(ctx context.Context, op string)
- type Server
- func (s *Server) Endpoint() (*url.URL, error)
- func (s *Server) Name() string
- func (s *Server) RegisterConnectHandler(namespace string, f func(socketIo.Conn) error)
- func (s *Server) RegisterDisconnectHandler(namespace string, f func(socketIo.Conn, string))
- func (s *Server) RegisterErrorHandler(namespace string, f func(socketIo.Conn, error))
- func (s *Server) RegisterEventHandler(namespace, event string, f interface{})
- func (s *Server) Start(_ context.Context) error
- func (s *Server) Stop(_ context.Context) error
- type ServerOption
- func WithAddress(addr string) ServerOption
- func WithCodec(c string) ServerOption
- func WithConnectHandler(namespace string, f func(socketIo.Conn) error) ServerOption
- func WithDisconnectHandler(namespace string, f func(socketIo.Conn, string)) ServerOption
- func WithErrorHandler(namespace string, f func(socketIo.Conn, error)) ServerOption
- func WithEventHandler(namespace, event string, f interface{}) ServerOption
- func WithNetwork(network string) ServerOption
- func WithPath(path string) ServerOption
- func WithTLSConfig(c *tls.Config) ServerOption
- type Transport
- func (tr *Transport) Endpoint() string
- func (tr *Transport) Kind() kratosTransport.Kind
- func (tr *Transport) Operation() string
- func (tr *Transport) PathTemplate() string
- func (tr *Transport) ReplyHeader() kratosTransport.Header
- func (tr *Transport) Request() *http.Request
- func (tr *Transport) RequestHeader() kratosTransport.Header
- type Transporter
Constants ¶
View Source
const (
KindSocketIo kratosTransport.Kind = "socket.io"
)
Variables ¶
This section is empty.
Functions ¶
func SetOperation ¶
SetOperation sets the transport operation.
Types ¶
type Server ¶
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
func (*Server) RegisterConnectHandler ¶
func (*Server) RegisterDisconnectHandler ¶
func (*Server) RegisterErrorHandler ¶
func (*Server) RegisterEventHandler ¶
type ServerOption ¶
type ServerOption func(o *Server)
func WithAddress ¶
func WithAddress(addr string) ServerOption
func WithCodec ¶
func WithCodec(c string) ServerOption
func WithConnectHandler ¶
func WithConnectHandler(namespace string, f func(socketIo.Conn) error) ServerOption
func WithDisconnectHandler ¶
func WithDisconnectHandler(namespace string, f func(socketIo.Conn, string)) ServerOption
func WithErrorHandler ¶
func WithErrorHandler(namespace string, f func(socketIo.Conn, error)) ServerOption
func WithEventHandler ¶
func WithEventHandler(namespace, event string, f interface{}) ServerOption
func WithNetwork ¶
func WithNetwork(network string) ServerOption
func WithPath ¶
func WithPath(path string) ServerOption
func WithTLSConfig ¶
func WithTLSConfig(c *tls.Config) ServerOption
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a websocket transport.
func (*Transport) Kind ¶
func (tr *Transport) Kind() kratosTransport.Kind
Kind returns the transport kind.
func (*Transport) PathTemplate ¶
PathTemplate returns the http path template.
func (*Transport) ReplyHeader ¶
func (tr *Transport) ReplyHeader() kratosTransport.Header
ReplyHeader returns the reply header.
func (*Transport) RequestHeader ¶
func (tr *Transport) RequestHeader() kratosTransport.Header
RequestHeader returns the request header.
type Transporter ¶
type Transporter interface { kratosTransport.Transporter Request() *http.Request PathTemplate() string }
Click to show internal directories.
Click to hide internal directories.