conf

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: MIT Imports: 15 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 {
	DbSource   string   `json:"db"`
	Storage    string   `json:"storage"`
	Host       string   `json:"host"`
	Port       uint     `json:"port"`
	Timeout    int64    `json:"timeout"`
	Secure     bool     `json:"secure"`
	Salt       string   `json:"salt"`
	GCPeriod   int64    `json:"gc_period"`
	Settings   settings `json:"settings"`
	StorageDir string
	Db         *sql.DB
	Templates  map[string]*template.Template
	ErrLogger  *log.Logger

	Ch chan *db.Item
	// contains filtered or unexported fields
}

Cfg is configuration settings.

func New

func New(filename string, l *log.Logger) (*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) HandleTimeout

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

HandleTimeout is service timeout.

func (*Cfg) MaxFileSize

func (c *Cfg) MaxFileSize() int

MaxFileSize return max file size.

func (*Cfg) Secret

func (c *Cfg) Secret(p string) string

Secret returns secret string.

Jump to

Keyboard shortcuts

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