services

package module
v0.0.0-...-e5d72f9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Services Framework github.com/dungw3b/services

Services Framework github.com/dungw3b/services

Index

Constants

This section is empty.

Variables

View Source
var (
	Config   map[string]interface{}
	Services []Service
)

Functions

func GetConfigInt

func GetConfigInt(name string) int

func GetConfigString

func GetConfigString(name string) string

func GetService

func GetService(name string) interface{}

func Init

func Init(parser ParseConfigFunc)

func Run

func Run(services ...Service)

func SetConfig

func SetConfig(name string, value interface{})

Types

type ParseConfigFunc

type ParseConfigFunc func(cfg *config.Config)

type Service

type Service interface {
	Name() string             // return service name
	Init()                    // initial service
	Start() error             // start service
	Stop()                    // graceful stop service
	GetInstance() interface{} // get instance
	ReloadData()              // reload configuration
}

Directories

Path Synopsis
Services Framework github.com/dungw3b/services
Services Framework github.com/dungw3b/services

Jump to

Keyboard shortcuts

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