MCPcopy
hub / github.com/gotify/server / New

Function New

api/stream/stream.go:31–38  ·  view source on GitHub ↗

New creates a new instance of API. pingPeriod: is the interval, in which is server sends the a ping to the client. pongTimeout: is the duration after the connection will be terminated, when the client does not respond with the pong command.

(pingPeriod, pongTimeout time.Duration, allowedWebSocketOrigins []string)

Source from the content-addressed store, hash-verified

29// pongTimeout: is the duration after the connection will be terminated, when the client does not respond with the
30// pong command.
31func New(pingPeriod, pongTimeout time.Duration, allowedWebSocketOrigins []string) *API {
32 return &API{
33 clients: make(map[uint][]*client),
34 pingPeriod: pingPeriod,
35 pongTimeout: pingPeriod + pongTimeout,
36 upgrader: newUpgrader(allowedWebSocketOrigins),
37 }
38}
39
40// CollectConnectedClientTokens returns all tokens of the connected clients.
41func (a *API) CollectConnectedClientTokens() []string {

Callers 2

CreateFunction · 0.92
bootTestServerFunction · 0.70

Calls 1

newUpgraderFunction · 0.85

Tested by 1

bootTestServerFunction · 0.56