Documentation ¶
Overview ¶
Package server offers a simple server with logging and configs
Index ¶
- type Logger
- type Server
- func (s *Server) Config(key string) string
- func (s *Server) ConfigBool(key string) bool
- func (s *Server) ConfigInt(key string) int64
- func (s *Server) Configuration() map[string]string
- func (s *Server) Fatal(format string)
- func (s *Server) Fatalf(format string, v ...interface{})
- func (s *Server) Log(message string)
- func (s *Server) Logf(format string, v ...interface{})
- func (s *Server) Mode() string
- func (s *Server) Port() int
- func (s *Server) Production() bool
- func (s *Server) Start() error
- func (s *Server) Timef(format string, start time.Time, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Printf(format string, args ...interface{})
}
Logger interface for a simple logger (the stdlib log pkg and the fragmenta log pkg conform)
type Server ¶
type Server struct { // Our internal logger instance Logger Logger // contains filtered or unexported fields }
Server holds the config and logger for the app
func (*Server) ConfigBool ¶
ConfigBool returns the current configuration value as bool (yes=true, no=false), or false if no value
func (*Server) ConfigInt ¶
ConfigInt returns the current configuration value as int64, or 0 if no value
func (*Server) Configuration ¶
Configuration returns the map of configuration keys to values
func (*Server) Fatalf ¶
Fatalf the message with the given arguments to our internal logger, and then exits with status 1
func (*Server) Production ¶
Production tells the caller if this server is in production mode or not?
Directories ¶
Path | Synopsis |
---|---|
Package log provides a simple file and console log
|
Package log provides a simple file and console log |
Package schedule provides a simple way to schedule functions at a time or interval Package schedule provides a simple way to schedule functions at a time or interval
|
Package schedule provides a simple way to schedule functions at a time or interval Package schedule provides a simple way to schedule functions at a time or interval |
Click to show internal directories.
Click to hide internal directories.