Documentation ¶
Index ¶
- Constants
- type Config
- func (c *Config) Addr() string
- func (c *Config) Close() error
- func (c *Config) DbPeriod() time.Duration
- func (c *Config) GCPeriod() time.Duration
- func (c *Config) MaxFileSize() int
- func (c *Config) Secret(p string) string
- func (c *Config) Shutdown() time.Duration
- func (c *Config) Timeout() time.Duration
- type Settings
- type Storage
- type TemplateEntry
Constants ¶
View Source
const ( BaseTpl = "base.html" IndexTpl = "index.html" UploadTpl = "upload.html" DownloadTpl = "download.html" ErrorTpl = "error.html" )
html templates names
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Server server `toml:"server"` Storage Storage `toml:"Storage"` Settings Settings `toml:"settings"` }
Config is a main configuration structure.
func New ¶
func New(filename string, t *TemplateEntry) (*Config, error)
New returns new configuration.
type Settings ¶
type Settings struct { TTL int `toml:"ttl"` Times int `toml:"times"` Size int `toml:"size"` Salt string `toml:"salt"` GC int `toml:"gc"` PassLen int `toml:"passlen"` Shutdown int `toml:"shutdown"` Tpl map[string]*template.Template `toml:"-"` }
Settings is base service settings.
type Storage ¶
type Storage struct { File string `toml:"file"` Dir string `toml:"dir"` Timeout int `toml:"timeout"` Size int64 `toml:"size"` Db *sql.DB // contains filtered or unexported fields }
Storage is storage configuration params struct.
Click to show internal directories.
Click to hide internal directories.