Documentation ¶
Index ¶
- func FromJson(jsonString string, typeItem reflect.Type) (interface{}, error)
- func GetConfigurationFromSources(sources []source.Source) (config.Config, error)
- func ToJson(obj interface{}) (result string, err error)
- func Write200Json(w http.ResponseWriter, content string)
- func Write404Json(w http.ResponseWriter)
- func Write500Json(w http.ResponseWriter, message string)
- type Application
- type Configuration
- type DefaultLogger
- type Extension
- type HeaderConfiguration
- type Logger
- type NoOpExtension
- type SilentLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromJson ¶ added in v0.3.9
typeOfPtr should be the type of a pointer to the type you're unmarshalling to
func Write200Json ¶ added in v0.3.4
func Write200Json(w http.ResponseWriter, content string)
func Write404Json ¶
func Write404Json(w http.ResponseWriter)
func Write500Json ¶
func Write500Json(w http.ResponseWriter, message string)
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func (*Application) GetConfiguration ¶
func (ac *Application) GetConfiguration() *Configuration
func (*Application) GetLogger ¶
func (ac *Application) GetLogger() Logger
func (*Application) GetRouter ¶
func (ac *Application) GetRouter() *mux.Router
func (*Application) Init ¶
func (ac *Application) Init(config *Configuration, logger Logger, extensions []Extension) error
func (*Application) Run ¶
func (ac *Application) Run() error
type Configuration ¶
type Configuration struct { HeaderConfiguration HeaderConfiguration Port int Raw config.Config StaticDirectory string }
func LoadConfiguration ¶ added in v0.2.0
func LoadConfiguration(sources *[]source.Source) (*Configuration, error)
"merging priority is in reverse order" if nil, environment source used
type DefaultLogger ¶
type DefaultLogger struct{}
func (DefaultLogger) Debug ¶
func (logger DefaultLogger) Debug(message string)
func (DefaultLogger) Error ¶
func (logger DefaultLogger) Error(message string)
func (DefaultLogger) Info ¶
func (logger DefaultLogger) Info(message string)
func (DefaultLogger) Warn ¶
func (logger DefaultLogger) Warn(message string)
type Extension ¶
type Extension interface { Init(app *Application) error AddRoutes(app *Application) error Destroy(app *Application) error }
type HeaderConfiguration ¶
type NoOpExtension ¶
type NoOpExtension struct { }
func (*NoOpExtension) AddRoutes ¶
func (s *NoOpExtension) AddRoutes(app *Application) error
func (*NoOpExtension) Destroy ¶
func (s *NoOpExtension) Destroy(app *Application) error
func (*NoOpExtension) Init ¶
func (s *NoOpExtension) Init(app *Application) error
type SilentLogger ¶
type SilentLogger struct{}
func (SilentLogger) Debug ¶
func (logger SilentLogger) Debug(message string)
func (SilentLogger) Error ¶
func (logger SilentLogger) Error(message string)
func (SilentLogger) Info ¶
func (logger SilentLogger) Info(message string)
func (SilentLogger) Warn ¶
func (logger SilentLogger) Warn(message string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.