diff options
author | NikkyAI <root@nikky.moe> | 2020-08-26 22:27:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 22:27:00 +0200 |
commit | 27c02549c870680ea57a05757810ade80db42929 (patch) | |
tree | 011862f50e0101205afdb786ee3ff2503a677f22 /vendor/gopkg.in/olahol/melody.v1/config.go | |
parent | 88d371c71c61aa8b68033b9c2dd4d7a8fc36e991 (diff) | |
download | matterbridge-msglm-27c02549c870680ea57a05757810ade80db42929.tar.gz matterbridge-msglm-27c02549c870680ea57a05757810ade80db42929.tar.bz2 matterbridge-msglm-27c02549c870680ea57a05757810ade80db42929.zip |
Replace gorilla with melody for websocket API (#1205)
Diffstat (limited to 'vendor/gopkg.in/olahol/melody.v1/config.go')
-rw-r--r-- | vendor/gopkg.in/olahol/melody.v1/config.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/gopkg.in/olahol/melody.v1/config.go b/vendor/gopkg.in/olahol/melody.v1/config.go new file mode 100644 index 00000000..81ebd057 --- /dev/null +++ b/vendor/gopkg.in/olahol/melody.v1/config.go @@ -0,0 +1,22 @@ +package melody + +import "time" + +// Config melody configuration struct. +type Config struct { + WriteWait time.Duration // Milliseconds until write times out. + PongWait time.Duration // Timeout for waiting on pong. + PingPeriod time.Duration // Milliseconds between pings. + MaxMessageSize int64 // Maximum size in bytes of a message. + MessageBufferSize int // The max amount of messages that can be in a sessions buffer before it starts dropping them. +} + +func newConfig() *Config { + return &Config{ + WriteWait: 10 * time.Second, + PongWait: 60 * time.Second, + PingPeriod: (60 * time.Second * 9) / 10, + MaxMessageSize: 512, + MessageBufferSize: 256, + } +} |