Documentation ¶
Overview ¶
Package prlpks provides common configuration, logging and static content for the keyserver.
Index ¶
- Constants
- Variables
- func InitLog()
- func LoadConfig(r io.Reader) (err error)
- func LoadConfigFile(path string) (err error)
- func SetConfig(contents string) (err error)
- type Settings
- func (s *Settings) GetBool(key string) bool
- func (s *Settings) GetIntDefault(key string, defaultValue int) int
- func (s *Settings) GetString(key string) string
- func (s *Settings) GetStringDefault(key string, defaultValue string) string
- func (s *Settings) GetStrings(key string) (value []string)
- func (s *Settings) LogFile() string
- func (s *Settings) MustGetInt(key string) int
- func (s *Settings) Webroot() string
- type StaticRouter
Constants ¶
const APPLICATION_ERROR = "APPLICATION ERROR"
Response for HTTP 500.
const BAD_REQUEST = "BAD REQUEST"
Response for HTTP 400.
const INSTALL_WEBROOT = "/var/lib/prlpks/www"
System installed location for static files.
const PRLPKS_PKG = "github.com/pruthvirajsinh/prlpks" // Any way to introspect?
prlpks package, used to locate static files when running from source.
Variables ¶
var Version string
Version is set by the build process.
Functions ¶
func InitLog ¶
func InitLog()
InitLog initializes the logging output to the globally configured settings. It also registers SIGHUP, SIGUSR1 and SIGUSR2 to close and reopen the log file for logrotate(8) support.
BUG: If InitLog is called before the application is properly configured, it will automatically configure the application with an empty TOML (accept all defaults).
func LoadConfig ¶
LoadConfig sets the global configuration to the TOML-formatted reader contents.
func LoadConfigFile ¶
LoadConfigFile sets the global configuration to the contents from the TOML file path.
Types ¶
type Settings ¶
type Settings struct {
*toml.TomlTree
}
Settings stores configuration options for prlpks.
func Config ¶
func Config() *Settings
Config returns the global Settings for an application built with prlpks.
func (*Settings) GetBool ¶
GetBool returns the boolean value for the configuration key if set, otherwise false.
func (*Settings) GetIntDefault ¶
GetIntDefault returns the int value for the configuration key if set and valid, otherwise the default value.
func (*Settings) GetString ¶
GetString returns the string value for the configuration key if set, otherwise the empty string.
func (*Settings) GetStringDefault ¶
GetStringDefault returns the string value for the configuration key if set, otherwise the default value.
func (*Settings) GetStrings ¶
GetStrings returns a []string slice for the configuration key if set, otherwise an empty slice.
func (*Settings) MustGetInt ¶
MustGetInt returns the int value for the configuration key if set and valid, otherwise panics.
type StaticRouter ¶
StaticRouter configures HTTP request handlers for static media files.
func NewStaticRouter ¶
func NewStaticRouter(r *mux.Router) *StaticRouter
NewStaticRouter constructs a new static media router and sets up all request handlers.
func (*StaticRouter) HandleAll ¶
func (sr *StaticRouter) HandleAll()
HandleAll sets up all request handlers for prlpks static media.
func (*StaticRouter) HandleCss ¶
func (sr *StaticRouter) HandleCss()
HandleCSS handles all embedded cascading style sheet (CSS) requests.
func (*StaticRouter) HandleFonts ¶
func (sr *StaticRouter) HandleFonts()
HandleFonts handles all embedded web font requests.
func (*StaticRouter) HandleMainPage ¶
func (sr *StaticRouter) HandleMainPage()
HandleMainPage handles the "/" top-level request.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
prlpks
prlpks is an OpenPGP keyserver.
|
prlpks is an OpenPGP keyserver. |
Package hkp implements the OpenPGP HTTP Keyserver Protocol, as described in the Internet-Draft, http://ietfreport.isoc.org/idref/draft-shaw-openpgp-hkp/.
|
Package hkp implements the OpenPGP HTTP Keyserver Protocol, as described in the Internet-Draft, http://ietfreport.isoc.org/idref/draft-shaw-openpgp-hkp/. |
Package openpgp parses, merges, validates, stores and searches OpenPGP public key material in RFC4880 format.
|
Package openpgp parses, merges, validates, stores and searches OpenPGP public key material in RFC4880 format. |
Package util contains a few commonly used utility functions.
|
Package util contains a few commonly used utility functions. |