settings

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrFileIsNotSet = "file is not set"
	ErrHttpSetting  = "error in HTTP server setting"
	ErrSmtpSetting  = "error in SMTP server setting"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpSettings

type HttpSettings struct {
	Host string `json:"host"`
	Port uint16 `json:"port"`
}

HttpSettings are settings of an HTTP server for incoming requests.

type Settings

type Settings struct {
	// Path to the file with these settings.
	FilePath string `json:"-"`

	HttpSettings `json:"http"`
	SmtpSettings `json:"smtp"`
}

Settings is Server's settings.

func NewSettingsFromFile

func NewSettingsFromFile(filePath string) (stn *Settings, err error)

func (*Settings) Check

func (stn *Settings) Check() (err error)

type SmtpSettings

type SmtpSettings struct {
	Host      string `json:"host"`
	Port      uint16 `json:"port"`
	User      string `json:"user"`
	Password  string `json:"password"`
	UserAgent string `json:"userAgent"`
}

SmtpSettings are parameters of the SMTP server used for sending e-mail messages. When a password is not set, it is taken from the stdin.

Jump to

Keyboard shortcuts

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