Documentation ¶
Index ¶
- func ListenAndServe(addr string, url string, secretKey string, tokenKey string, opts *ServeOptions) error
- func NewRedisPool() *redis.Pool
- func Serve(hub *Hub, tokenKey *[32]byte, w http.ResponseWriter, r *http.Request)
- type Hub
- type Redis
- func (r *Redis) Delete(ctx context.Context, k string) error
- func (r *Redis) Expire(ctx context.Context, k string, dt time.Duration) error
- func (r *Redis) Get(ctx context.Context, k string) (string, error)
- func (r *Redis) Increment(ctx context.Context, k string) (int64, error)
- func (r *Redis) Set(ctx context.Context, k string, v string) error
- func (r *Redis) Subscribe() error
- type ServeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
func ListenAndServe(addr string, url string, secretKey string, tokenKey string, opts *ServeOptions) error
ListenAndServe starts the server.
Types ¶
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
Click to show internal directories.
Click to hide internal directories.