Documentation ¶
Index ¶
- func GetClientsConfigFile() string
- func GetResourceFile(p ...string) string
- func GetStaticFilesDir() string
- func InitLogEnv()
- func MakeTemplate(name string) *template.Template
- func MakeUrl(pathFormat string, param ...interface{}) string
- func SetResourcesPath(res string)
- func SmtpCheck() error
- type DbConfig
- type LogEnv
- type LogLocations
- type ServerConfig
- type SmtpCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientsConfigFile ¶
func GetClientsConfigFile() string
GetClientsConfigFile returns the path to the clients configuration file.
func GetResourceFile ¶
GetResourceFile returns the path to a resource file using the global resource path. The path will be constructed from the resource path and all given path elements in p.
func GetStaticFilesDir ¶
func GetStaticFilesDir() string
GetStaticFilesDir returns the path to the static files directory.
func InitLogEnv ¶
func InitLogEnv()
InitLogEnv initializes loggers for access and error. Default access log directs to Stdout, default error log directs to Stderr. If log files are provided, the output will be directed to the respective default and the log file. Log files are opened using a logrotate compatible library.
func MakeTemplate ¶
MakeTemplate loads a template using the default layout and the given content template file.
func MakeUrl ¶
MakeUrl makes a URL for other web resources provided by gin-auth using the base url from the server config file.
func SetResourcesPath ¶
func SetResourcesPath(res string)
SetResourcesPath sets the resource path to the specified location. This function should only be used before other helpers from the conf package are used.
Types ¶
type DbConfig ¶
DbConfig contains data needed to connect to a SQL database. The struct contains yaml annotations in order to be compatible with gooses database configuration file (resources/conf/dbconf.yml)
func GetDbConfig ¶
func GetDbConfig() *DbConfig
GetDbConfig loads a database configuration from a yaml file when called the first time. Returns a struct with configuration information.
type LogEnv ¶
LogEnv provides the logging environment with error and access log and a function to defer closing any associated files.
type LogLocations ¶
LogLocations contains paths to the Access and Error log files.
func GetLogLocation ¶
func GetLogLocation() *LogLocations
GetLogLocation loads log file locations from a yaml file when called the first time. Returns a struct with the log file locations.
type ServerConfig ¶
type ServerConfig struct { Host string Port int BaseURL string SessionLifeTime time.Duration TokenLifeTime time.Duration GrantReqLifeTime time.Duration UnusedAccountLifeTime time.Duration CleanerInterval time.Duration MailQueueInterval time.Duration }
ServerConfig provides several general configuration parameters for gin-auth
func GetServerConfig ¶
func GetServerConfig() *ServerConfig
GetServerConfig loads the server configuration from a yaml file when called the first time. Returns a struct with configuration information.
type SmtpCredentials ¶
type SmtpCredentials struct { From string Username string Password string Host string Port int Mode string }
SmtpCredentials contains the credentials required to send e-mails via smtp. Mode constitutes a switch whether e-mails should actually be sent or not. Supported values of Mode are: print and skip; print will write the content of any e-mail to the commandline / log, skip will skip over any e-mail sending process. For any other value of "Mode" e-mails will be sent.
func GetSmtpCredentials ¶
func GetSmtpCredentials() *SmtpCredentials
GetSmtpCredentials loads the smtp access information from a yaml file when called the first time. Returns a struct with the smtp credentials.