prlpks

package
v0.0.0-...-cbc4e0b Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2014 License: AGPL-3.0, AGPL-3.0 Imports: 14 Imported by: 0

README

prlpks

A GPG Public Key Server based on hockeypuck (launchpad.net/hockeypuck) of casey marshall.

How to install

For fresh Install

1.run prlpks_install.sh 2.the script will output instructions after finishing compiling. 3.config file is self explanatory and must be configured fully before running.

Documentation

Overview

Package prlpks provides common configuration, logging and static content for the keyserver.

Index

Constants

View Source
const APPLICATION_ERROR = "APPLICATION ERROR"

Response for HTTP 500.

View Source
const BAD_REQUEST = "BAD REQUEST"

Response for HTTP 400.

View Source
const INSTALL_WEBROOT = "/var/lib/prlpks/www"

System installed location for static files.

View Source
const PRLPKS_PKG = "github.com/pruthvirajsinh/prlpks" // Any way to introspect?

prlpks package, used to locate static files when running from source.

Variables

View Source
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

func LoadConfig(r io.Reader) (err error)

LoadConfig sets the global configuration to the TOML-formatted reader contents.

func LoadConfigFile

func LoadConfigFile(path string) (err error)

LoadConfigFile sets the global configuration to the contents from the TOML file path.

func SetConfig

func SetConfig(contents string) (err error)

SetConfig sets the global configuration to the TOML-formatted string contents.

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

func (s *Settings) GetBool(key string) bool

GetBool returns the boolean value for the configuration key if set, otherwise false.

func (*Settings) GetIntDefault

func (s *Settings) GetIntDefault(key string, defaultValue int) int

GetIntDefault returns the int value for the configuration key if set and valid, otherwise the default value.

func (*Settings) GetString

func (s *Settings) GetString(key string) string

GetString returns the string value for the configuration key if set, otherwise the empty string.

func (*Settings) GetStringDefault

func (s *Settings) GetStringDefault(key string, defaultValue string) string

GetStringDefault returns the string value for the configuration key if set, otherwise the default value.

func (*Settings) GetStrings

func (s *Settings) GetStrings(key string) (value []string)

GetStrings returns a []string slice for the configuration key if set, otherwise an empty slice.

func (*Settings) LogFile

func (s *Settings) LogFile() string

Logfile option

func (*Settings) MustGetInt

func (s *Settings) MustGetInt(key string) int

MustGetInt returns the int value for the configuration key if set and valid, otherwise panics.

func (*Settings) Webroot

func (s *Settings) Webroot() string

type StaticRouter

type StaticRouter struct {
	*mux.Router
}

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.

Jump to

Keyboard shortcuts

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