application

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package errors implements functions to manipulate errors.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid           = errors.New("validation failed")
	ErrUnauthorized      = errors.New("access denied")
	ErrForbidden         = errors.New("forbidden")
	ErrNotFound          = errors.New("not found")
	ErrInternal          = errors.New("internal system error")
	ErrTemporaryDisabled = errors.New("temporary disabled")
	ErrTimeout           = errors.New("timeout")
)

Application errors

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Adapter interface

type App

type App struct {
	// contains filtered or unexported fields
}

App represents application service

func New

func New(logger *log.Logger) *App

New provides new service application

func (*App) AddAdapters

func (app *App) AddAdapters(adapters ...Adapter)

AddAdapters adds adapters to application service

func (*App) Run

func (app *App) Run(ctx context.Context)

Run runs the service application

func (*App) WithShutdownTimeout

func (app *App) WithShutdownTimeout(timeout time.Duration)

WithShutdownTimeout overrides default shutdown timout

type DebugAdapter

type DebugAdapter struct {
	*http.Server
}

DebugAdapter ./...

func NewDebugAdapter

func NewDebugAdapter(address string) *DebugAdapter

NewDebugAdapter provides new debug adapter /debug/pprof - Added to the default mux by importing the net/http/pprof package. /debug/vars - Added to the default mux by importing the expvar package.

func (*DebugAdapter) Start

func (adapter *DebugAdapter) Start(ctx context.Context) error

Start start http application adapter

func (*DebugAdapter) Stop

func (adapter *DebugAdapter) Stop(ctx context.Context) error

Stop stops http application adapter

Jump to

Keyboard shortcuts

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