Documentation ¶
Index ¶
- Constants
- func SetOperation(ctx context.Context, op string)
- type Client
- type ClientArray
- type ClientMap
- type ConnectHandler
- type EchoHandler
- type Handler
- type Message
- type Server
- func (s *Server) Broadcast(message *Message)
- func (s *Server) ClientCount() int
- func (s *Server) Endpoint() (*url.URL, error)
- func (s *Server) Name() string
- func (s *Server) SendMessage(connectionId string, message *Message)
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) Stop(ctx context.Context) error
- type ServerOption
- func Address(addr string) ServerOption
- func ConnectHandle(h ConnectHandler) ServerOption
- func EchoHandle(path string, h EchoHandler) ServerOption
- func Listener(lis net.Listener) ServerOption
- func Logger(logger log.Logger) ServerOption
- func Network(network string) ServerOption
- func ReadHandle(path string, h Handler) ServerOption
- func TLSConfig(c *tls.Config) ServerOption
- func Timeout(timeout time.Duration) ServerOption
- type Transport
- func (tr *Transport) Endpoint() string
- func (tr *Transport) Kind() transport.Kind
- func (tr *Transport) Operation() string
- func (tr *Transport) PathTemplate() string
- func (tr *Transport) ReplyHeader() transport.Header
- func (tr *Transport) Request() *http.Request
- func (tr *Transport) RequestHeader() transport.Header
- type Transporter
Constants ¶
View Source
const (
KindWebsocket transport.Kind = "websocket"
)
Variables ¶
This section is empty.
Functions ¶
func SetOperation ¶
SetOperation sets the transport operation.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ConnectionID ¶
func (*Client) SendMessage ¶
type ClientArray ¶
type ClientArray []*Client
type ConnectHandler ¶
type Server ¶
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
func (*Server) ClientCount ¶
func (*Server) SendMessage ¶
type ServerOption ¶
type ServerOption func(o *Server)
func Address ¶
func Address(addr string) ServerOption
func ConnectHandle ¶
func ConnectHandle(h ConnectHandler) ServerOption
func EchoHandle ¶
func EchoHandle(path string, h EchoHandler) ServerOption
func Listener ¶
func Listener(lis net.Listener) ServerOption
func Logger ¶
func Logger(logger log.Logger) ServerOption
func Network ¶
func Network(network string) ServerOption
func ReadHandle ¶
func ReadHandle(path string, h Handler) ServerOption
func TLSConfig ¶
func TLSConfig(c *tls.Config) ServerOption
func Timeout ¶
func Timeout(timeout time.Duration) ServerOption
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a websocket transport.
func (*Transport) PathTemplate ¶
PathTemplate returns the http path template.
func (*Transport) ReplyHeader ¶
ReplyHeader returns the reply header.
func (*Transport) RequestHeader ¶
RequestHeader returns the request header.
type Transporter ¶
type Transporter interface { transport.Transporter Request() *http.Request PathTemplate() string }
Click to show internal directories.
Click to hide internal directories.