options

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiOriginAllow

type ApiOriginAllow struct {
	AllowCors    bool   `json:"allowCors"`
	AllowOrigin  string `json:"allowOrigin"`
	AllowMethods string `json:"allowMethods"`
	AllowHeaders string `json:"allowHeaders"`
}

type Client

type Client struct {
	AppId string `json:"appId"`
	Key   string `json:"key"`
}

type Config

type Config struct {
	AuthHost       any               `json:"authHost"`
	AuthEndpoint   string            `json:"authEndpoint"`
	Clients        []Client          `json:"clients"`
	Database       string            `json:"database"`
	DatabaseConfig DatabaseConfig    `json:"databaseConfig"`
	DevMode        bool              `json:"devMode"`
	Host           any               `json:"host"`
	Port           string            `json:"port"`
	Protocol       string            `json:"protocol"`
	Socketio       *ServerOptions    `json:"socketio"`
	SslCertPath    string            `json:"sslCertPath"`
	SslKeyPath     string            `json:"sslKeyPath"`
	Subscribers    Subscribers       `json:"subscribers"`
	ApiOriginAllow ApiOriginAllow    `json:"apiOriginAllow"`
	Headers        map[string]string `json:"header"`
}

func Assign

func Assign(_old *Config, _new *Config) (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Redis           Redis  `json:"redis"`
	Sqlite          Sqlite `json:"sqlite"`
	PublishPresence bool   `json:"publishPresence"`
}

type Hosts

type Hosts []string

type Redis

type Redis struct {
	Host      string `json:"host"`
	Port      string `json:"port"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	KeyPrefix string `json:"keyPrefix"`
	Db        int    `json:"db"`
}

type ServerOptions added in v1.1.0

type ServerOptions struct {
	// how many ms without a pong packet to consider the connection closed
	PingTimeout *int64 `json:"pingTimeout,omitempty"`

	// how many ms before sending a new ping packet
	PingInterval *int64 `json:"pingInterval,omitempty"`

	// how many ms before an uncompleted transport upgrade is cancelled
	UpgradeTimeout *int64 `json:"upgradeTimeout,omitempty"`

	// how many bytes or characters a message can be, before closing the session (to avoid DoS).
	MaxHttpBufferSize *int64 `json:"maxHttpBufferSize,omitempty"`

	// whether to allow transport upgrades
	AllowUpgrades *bool `json:"allowUpgrades,omitempty"`

	// parameters of the WebSocket permessage-deflate extension (see ws module api docs). Set to false to disable.
	PerMessageDeflate *types.PerMessageDeflate `json:"perMessageDeflate,omitempty"`

	// parameters of the http compression for the polling transports (see zlib api docs). Set to false to disable.
	HttpCompression *types.HttpCompression `json:"httpCompression,omitempty"`

	// the options that will be forwarded to the cors module
	Cors *types.Cors `json:"cors,omitempty"`

	// whether to enable compatibility with Socket.IO v2 clients
	AllowEIO3 *bool `json:"allowEIO3,omitempty"`

	// name of the path to capture
	Path *string `json:"path,omitempty"`

	// destroy unhandled upgrade requests
	DestroyUpgrade *bool `json:"destroyUpgrade,omitempty"`

	//  milliseconds after which unhandled requests are ended
	DestroyUpgradeTimeout *int64 `json:"destroyUpgradeTimeout,omitempty"`

	// whether to serve the client files
	ServeClient *bool `json:"serveClient,omitempty"`

	// how many ms before a client without namespace is closed
	ConnectTimeout *int64 `json:"connectTimeout,omitempty"`
}

func (*ServerOptions) Config added in v1.1.0

func (s *ServerOptions) Config() *socket.ServerOptions

type Sqlite

type Sqlite struct {
	DatabasePath string `json:"databasePath"`
}

type Subscribers

type Subscribers struct {
	Http  bool `json:"http"`
	Redis bool `json:"redis"`
}

Jump to

Keyboard shortcuts

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