app

package
v0.0.0-...-d1245af Latest Latest
Warning

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

Go to latest
Published: May 28, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App represents nephele application.

func New

func New(configure Configurator) *App

Return new nephele application with given configuration.

func (*App) Run

func (app *App) Run()

Run nephele application.

func (*App) Server

func (app *App) Server() *Server

Return server to make initialization or configure service router.

type Config

type Config interface {
	// Return current environment
	Env() string

	// Return log config.
	Log() log.Config

	// Returns store config.
	Store() store.Config

	// Return codec config.
	Codec() codec.Config

	// Return service config.
	Service() service.Config

	// Implements how to parse config.
	LoadFrom(env, path string) error

	// Reload
	Reload() error
}

Config represents configuration for all components

type Configurator

type Configurator func(string) Config

Define configurator by runtime environment

type Server

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

Server represents holder for service and is the entry for all components to initialize, open or quit.

func (*Server) OnInit

func (s *Server) OnInit(init ServerInitializeFunc)

Call to make external components initialization.

func (*Server) OnQuit

func (s *Server) OnQuit(quit ServerQuitFunc)

call to quit external components

func (*Server) Service

func (s *Server) Service() *service.Service

Return service to register router or modify image handler path.

type ServerInitializeFunc

type ServerInitializeFunc func(*Server) error

Define server initialization function type. It's called before server opened.

type ServerQuitFunc

type ServerQuitFunc func(*Server) error

Define server quit function type. It's called after service no longer serving any image request.

Jump to

Keyboard shortcuts

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