conf

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package conf implements methods setup configuration settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Host      string   `json:"host"`
	Port      uint     `json:"port"`
	Timeout   int64    `json:"timeout"`
	Secure    bool     `json:"secure"`
	Redis     *db.Cfg  `json:"redis"`
	Key       string   `json:"key"`
	Settings  settings `json:"settings"`
	CipherKey []byte
	Templates map[string]*template.Template
	// contains filtered or unexported fields
}

Cfg is configuration settings.

func New

func New(filename string) (*Cfg, error)

New returns new configuration.

func (*Cfg) Addr

func (c *Cfg) Addr() string

Addr returns service's net address.

func (*Cfg) Close

func (c *Cfg) Close() error

Close frees resources.

func (*Cfg) Connection

func (c *Cfg) Connection() redis.Conn

Connection return new database connection.

func (*Cfg) HandleTimeout

func (c *Cfg) HandleTimeout() time.Duration

HandleTimeout is service timeout.

Jump to

Keyboard shortcuts

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