greeting

package
v0.0.0-...-fcddabd Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2019 License: MIT Imports: 3 Imported by: 0

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 Hello

type Hello struct {
	Message string
}

Hello is the common greeting.

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

type HelloWorldOutput interface {
	// Say outputs hello.
	Say(ctx context.Context, hello Hello)
}

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 SaidHello

type SaidHello struct {
	Message string
}

SaidHello indicates that hello was said.

type SaidHelloTo

type SaidHelloTo struct {
	Message string
	Who     string
}

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

type SayHelloOutput interface {
	// Say outputs hello.
	Say(ctx context.Context, hello Hello)
}

SayHelloOutput is the output channel for saying hello.

type SayHelloTo

type SayHelloTo struct {
	Who string
}

SayHelloTo contains who to say hello to.

Directories

Path Synopsis
nolint: dupl nolint: dupl
nolint: dupl nolint: dupl

Jump to

Keyboard shortcuts

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