Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶
type ErrorHandler interface { // Handle handles an error. Handle(err error) }
ErrorHandler handles an error.
type HelloWorld ¶
type HelloWorld struct {
// contains filtered or unexported fields
}
HelloWorld outputs Hello World.
func NewHelloWorld ¶
func NewHelloWorld(events HelloWorldEvents, logger Logger, errorHandler ErrorHandler) *HelloWorld
NewHelloWorld returns a new HelloWorld instance.
func (*HelloWorld) HelloWorld ¶
func (hw *HelloWorld) HelloWorld(ctx context.Context, output HelloWorldOutput)
HelloWorld outputs Hello World.
type HelloWorldEvents ¶
type HelloWorldEvents interface { // SaidHello dispatches a SaidHello event. SaidHello(ctx context.Context, event SaidHello) error }
HelloWorldEvents is the dispatcher for hello world events.
type HelloWorldOutput ¶
HelloWorldOutput is the output channel for saying hello to the world.
type Logger ¶
type Logger interface { // Trace logs a debug event. Trace(msg string, fields ...map[string]interface{}) // Debug logs a debug event. Debug(msg string, fields ...map[string]interface{}) // Info logs an info event. Info(msg string, fields ...map[string]interface{}) // Warn logs a warning event. Warn(msg string, fields ...map[string]interface{}) // Error logs an error event. Error(msg string, fields ...map[string]interface{}) // WithFields annotates a logger with some context. WithFields(fields map[string]interface{}) Logger }
Logger is the fundamental interface for all log operations.
type SaidHelloTo ¶
SaidHelloTo indicates that hello was said to someone.
type SayHello ¶
type SayHello struct {
// contains filtered or unexported fields
}
SayHello says hello to someone.
func NewSayHello ¶
func NewSayHello(events SayHelloEvents, logger Logger, errorHandler ErrorHandler) *SayHello
NewSayHello returns a new SayHello instance.
func (*SayHello) SayHello ¶
func (sh *SayHello) SayHello(ctx context.Context, to SayHelloTo, output SayHelloOutput)
SayHello says hello to someone.
type SayHelloEvents ¶
type SayHelloEvents interface { // SaidHelloTo dispatches a SaidHelloTo event. SaidHelloTo(ctx context.Context, event SaidHelloTo) error }
SayHelloEvents is the dispatcher for say hello events.
type SayHelloOutput ¶
SayHelloOutput is the output channel for saying hello.
Click to show internal directories.
Click to hide internal directories.