application

package module
v0.1.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 9 Imported by: 0

README

Go Application Last release Documentation

Go Report Card

Branch Status Coverage
master Build Status Coveralls

go-application is a HTTP micro-framework library for Go.

Example

package main

import (
    "github.com/euskadi31/go-application"
    "github.com/euskadi31/go-application/provider"
)

func main() {
    app := application.New()

    app.Register(provider.NewEventDispatcherServiceProvider())
    app.Register(provider.NewHTTPServiceProvider())

    defer func() {
        if err := app.Close(); err != nil {
            panic(err)
        }
    }()

    if err := app.Run(); err != nil {
        panic(err)
    }
}

License

go-application is licensed under the MIT license.

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 struct

func (*App) Close

func (a *App) Close() error

Close Application

func (*App) Register

func (a *App) Register(provider ServiceProvider)

Register ServiceProvider

func (*App) Run

func (a *App) Run() (err error)

Run Application

type Application

type Application interface {
	Register(provider ServiceProvider)
	Run() error
	Close() error
}

Application interface

func New

func New() Application

New Application

type BootableProvider

type BootableProvider interface {
	Priority() int
	Start(app service.Container) error
	Stop(app service.Container) error
}

BootableProvider interface

type By

type By func(left, right BootableProvider) bool

By sorter

func (By) Sort

func (by By) Sort(providers []BootableProvider)

Sort is a method on the function type, By, that sorts the argument slice according to the function.

type EventListenerProvider

type EventListenerProvider interface {
	Subscribe(app service.Container, dispatcher eventemitter.EventEmitter)
}

EventListenerProvider interface

type MockBootableProvider

type MockBootableProvider struct {
	mock.Mock
}

MockBootableProvider is an autogenerated mock type for the BootableProvider type

func (*MockBootableProvider) Priority

func (_m *MockBootableProvider) Priority() int

Priority provides a mock function with given fields:

func (*MockBootableProvider) Start

Start provides a mock function with given fields: app

func (*MockBootableProvider) Stop

Stop provides a mock function with given fields: app

type MockEventListenerProvider

type MockEventListenerProvider struct {
	mock.Mock
}

MockEventListenerProvider is an autogenerated mock type for the EventListenerProvider type

func (*MockEventListenerProvider) Subscribe

func (_m *MockEventListenerProvider) Subscribe(app service.Container, dispatcher eventemitter.EventEmitter)

Subscribe provides a mock function with given fields: app, dispatcher

type MockServiceProvider

type MockServiceProvider struct {
	mock.Mock
}

MockServiceProvider is an autogenerated mock type for the ServiceProvider type

func (*MockServiceProvider) Register

func (_m *MockServiceProvider) Register(app service.Container)

Register provides a mock function with given fields: app

type ServiceProvider

type ServiceProvider interface {
	Register(app service.Container)
}

ServiceProvider interface

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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