Documentation
¶
Index ¶
- func NewClient(hub *WebsocketServer, w http.ResponseWriter, r *http.Request) (string, error)
- func NewClientWithEvent(hub *WebsocketServer, w http.ResponseWriter, r *http.Request, ...) (string, error)
- type Client
- type Context
- func (c *Context) Abort()
- func (c *Context) BindJson(obj any) error
- func (c *Context) Body() []byte
- func (c *Context) Get(key string) (value any, exists bool)
- func (c *Context) GetBool(key string) (b bool)
- func (c *Context) GetDuration(key string) (d time.Duration)
- func (c *Context) GetFloat64(key string) (f64 float64)
- func (c *Context) GetInt(key string) (i int)
- func (c *Context) GetInt64(key string) (i64 int64)
- func (c *Context) GetString(key string) (s string)
- func (c *Context) GetStringMap(key string) (sm map[string]any)
- func (c *Context) GetStringMapString(key string) (sms map[string]string)
- func (c *Context) GetStringMapStringSlice(key string) (smss map[string][]string)
- func (c *Context) GetStringSlice(key string) (ss []string)
- func (c *Context) GetTime(key string) (t time.Time)
- func (c *Context) GetUint(key string) (ui uint)
- func (c *Context) GetUint64(key string) (ui64 uint64)
- func (c *Context) Json(id string, data any)
- func (c *Context) Next()
- func (c *Context) Render(id string, msg []byte)
- func (c *Context) Set(key string, val any)
- func (c *Context) String(id, body string)
- type HandlerFunc
- type Message
- type Option
- type WebsocketServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(hub *WebsocketServer, w http.ResponseWriter, r *http.Request) (string, error)
func NewClientWithEvent ¶ added in v1.5.6
func NewClientWithEvent(hub *WebsocketServer, w http.ResponseWriter, r *http.Request, afterConnection, afterClose func(*Client)) (string, error)
Types ¶
type Context ¶
func (*Context) GetFloat64 ¶
func (*Context) GetStringMapString ¶
func (*Context) GetStringMapStringSlice ¶
func (*Context) GetStringSlice ¶
type HandlerFunc ¶
type HandlerFunc func(*Context)
type Option ¶
type Option func(opt *option)
func WithHandler ¶
func WithHandler(handles ...HandlerFunc) Option
type WebsocketServer ¶
type WebsocketServer struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...Option) *WebsocketServer
func (*WebsocketServer) Name ¶
func (w *WebsocketServer) Name() string
func (*WebsocketServer) SendMessage ¶
func (w *WebsocketServer) SendMessage(msg []byte)
Click to show internal directories.
Click to hide internal directories.