Documentation ¶
Index ¶
- type Application
- func (a *Application) Close(c io.Closer)
- func (a *Application) End(e Ender)
- func (a *Application) FailOnError(err error)
- func (a *Application) Monitor(main func() error)
- func (a *Application) Notify(name string, err error)
- func (a *Application) SignalTermination(main func()) chan os.Signal
- func (a *Application) Stop(s Stoper)
- func (a *Application) Trace(name string, main func(tracePoint *TracePoint) error) error
- type Ender
- type Stoper
- type TracePoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Logger golog.Logger Name string // contains filtered or unexported fields }
Application defines a way to seperate what we want dislosed.
func CreateApplication ¶
func CreateApplication(name string, logger golog.Logger) (*Application, error)
CreateApplication to seperate what we want dislose
func (*Application) FailOnError ¶
func (a *Application) FailOnError(err error)
FailOnError panics if there is an error
func (*Application) Monitor ¶
func (a *Application) Monitor(main func() error)
Monitor the application
func (*Application) Notify ¶
func (a *Application) Notify(name string, err error)
Notify an error has occured
func (*Application) SignalTermination ¶
func (a *Application) SignalTermination(main func()) chan os.Signal
SignalTermination handles SIGTERM
func (*Application) Trace ¶
func (a *Application) Trace(name string, main func(tracePoint *TracePoint) error) error
Trace a specific name
type Ender ¶
type Ender interface {
End() error
}
Ender is the interface that wraps the basic End method.
The behavior of End after the first call is undefined. Specific implementations may document their own behavior.
type Stoper ¶
type Stoper interface {
Stop() error
}
Stoper is the interface that wraps the basic Stop method.
The behavior of Stop after the first call is undefined. Specific implementations may document their own behavior.
type TracePoint ¶
type TracePoint struct {
// contains filtered or unexported fields
}
TracePoint is used for finer control of tracing
func (*TracePoint) AddMetrics ¶
func (t *TracePoint) AddMetrics(metrics map[string]interface{})
AddMetrics to the trace point.
func (*TracePoint) Trace ¶
func (t *TracePoint) Trace(name string, main func())
Trace a specific name