config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package config provides the main configuration

Index

Constants

View Source
const (
	DefaultListenHTTP        = ":80"
	DefaultCacheDuration     = 12 * time.Hour
	DefaultKeepaliveInterval = 30 * time.Second
	DefaultManagerInterval   = time.Minute
	DefaultAtSenderInterval  = 10 * time.Second
	DefaultMinDelay          = 10 * time.Second
	DefaultMaxDelay          = 3 * 24 * time.Hour
	DefaultMessageLimit      = 512
)

Defines default config settings

View Source
const (
	DefaultGlobalTopicLimit             = 5000
	DefaultVisitorRequestLimitBurst     = 60
	DefaultVisitorRequestLimitReplenish = 10 * time.Second
	DefaultVisitorSubscriptionLimit     = 30
)

Defines all the limits - global topic limit: max number of topics overall - per visistor request limit: max number of PUT/GET/.. requests (here: 60 requests bucket, replenished at a rate of one per 10 seconds) - per visistor subscription limit: max number of subscriptions (active HTTP connections) per per-visitor/IP

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenHTTP                   string
	ListenHTTPS                  string
	KeyFile                      string
	CertFile                     string
	FirebaseKeyFile              string
	CacheFile                    string
	CacheDuration                time.Duration
	KeepaliveInterval            time.Duration
	ManagerInterval              time.Duration
	AtSenderInterval             time.Duration
	MessageLimit                 int
	MinDelay                     time.Duration
	MaxDelay                     time.Duration
	GlobalTopicLimit             int
	VisitorRequestLimitBurst     int
	VisitorRequestLimitReplenish time.Duration
	VisitorSubscriptionLimit     int
	BehindProxy                  bool
}

Config is the main config struct for the application. Use New to instantiate a default config struct.

func New

func New(listenHTTP string) *Config

New instantiates a default new config

Jump to

Keyboard shortcuts

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