Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Time RetryPeriod = 1 * time.Second // Time allowed to write a message to the CDS server. WriteWait = 2 * time.Second // Time allowed to read the next pong message from the CDS server. PongWait = 8 * time.Second // Send pings to the CDS server with this period. Must be less than PongWait. PingPeriod = 5 * time.Second )
Functions ¶
func ParseConfig ¶
func ParseConfig(c []byte) (*stnrv1.StunnerConfig, error)
ParseConfig parses a raw buffer holding a configuration, substituting environment variables for placeholders in the configuration. Returns the new configuration or error if parsing fails.
func ZeroConfig ¶
func ZeroConfig(id string) *stnrv1.StunnerConfig
ZeroConfig builds a zero configuration useful for bootstrapping STUNner. It starts with plaintext authentication and opens no listeners and clusters.
Types ¶
type Client ¶
type Client interface {
// Load grabs a new configuration from the config client.
Load() (*stnrv1.StunnerConfig, error)
// Watch listens to new configurations and returns them on the channel ch. The context ctx
// cancels the watcher.
Watch(ctx context.Context, ch chan<- stnrv1.StunnerConfig) error
fmt.Stringer
}
Client represents a generic config client. Currently supported config providers: http, ws, or file. Configuration obtained through the client are not validated, make sure to validate on the receiver side.
type ConfigSkeleton ¶ added in v0.16.1
type ConfigSkeleton struct {
ApiVersion string `json:"version"`
}
Click to show internal directories.
Click to hide internal directories.