server

package
v0.0.0-...-6f18822 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package server is core logic shared by wspc wsps

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *Config) http.Handler

func NewWithHandler

func NewWithHandler(config *Config, handler http.Handler) http.Handler

Types

type Config

type Config struct {
	Log logger.Config `json:"log,omitempty"`

	SSL  SSL    `json:"ssl,omitempty"`
	Host string `json:"host,omitempty"`
	Auth string `json:"auth,omitempty"`
	Path string `json:"path,omitempty"`
	Port uint64 `json:"port,omitempty"`
}

func (*Config) EnbleSSL

func (c *Config) EnbleSSL() bool

type Hub

type Hub struct {
	// contains filtered or unexported fields
}

func (*Hub) Exist

func (s *Hub) Exist(channel string) (exist bool)

func (*Hub) Load

func (s *Hub) Load(channel string) (interface{}, bool)

func (*Hub) Remove

func (s *Hub) Remove(channel string)

func (*Hub) Store

func (s *Hub) Store(channel string, r interface{})

type SSL

type SSL struct {
	Enable bool   `json:"enable,omitempty"`
	Key    string `json:"key,omitempty"`
	Cert   string `json:"cert,omitempty"`
}

type Wsps

type Wsps struct {
	// contains filtered or unexported fields
}

func (*Wsps) ServeHTTP

func (s *Wsps) ServeHTTP(rw http.ResponseWriter, r *http.Request)

func (*Wsps) ServeProxy

func (s *Wsps) ServeProxy(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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