config

package
v0.0.0-...-8c28d06 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAccount

type AdminAccount struct {
	Username string
	Password string
}

AdminAccount represents an account needed for creating new channels

type Config

type Config struct {
	Server    *Server               `yaml:"server,omitempty"`
	Redis     *Redis                `yaml:"redis,omitempty"`
	NATS      *NATS                 `yaml:"nats,omitempty"`
	Admin     *AdminAccount         `yaml:"-"`
	Limits    map[goch.Limit][2]int `yaml:"limits,omitempty"`
	LimitErrs map[goch.Limit]error  `yaml:"-"`
}

Config represents application configuration

func Load

func Load(path string) (*Config, error)

Load loads config from file and env variables

func (*Config) Exceeds

func (c *Config) Exceeds(str string, lim goch.Limit) error

Exceeds checks whether a string exceeds chat limitation

func (*Config) ExceedsAny

func (c *Config) ExceedsAny(m map[string]goch.Limit) error

ExceedsAny checks whether any limit is exceeded

type NATS

type NATS struct {
	ClusterID string `yaml:"cluster_id"`
	ClientID  string `yaml:"client_id"`
	URL       string `yaml:"url"`
}

NATS holds credentials for NATS-Streaming server

type Redis

type Redis struct {
	Address  string `yaml:"address"`
	Port     int    `yaml:"port"`
	Password string `yaml:"-"`
}

Redis holds credentials for Redis

type Server

type Server struct {
	Port int `yaml:"port"`
}

Server holds data necessery for server configuration

Jump to

Keyboard shortcuts

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