service

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	AddService(service interface{}) (err error)
	GetService(service interface{}) (err error)
	HasService(service interface{}) (hasService bool)
	Log(err error, level log.Level)
}

Container of all services

func NewContainer

func NewContainer() (r Container)

NewContainer constructor

type Registry

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

Registry of all services

func (*Registry) AddService

func (r *Registry) AddService(service interface{}) (err error)

AddService a service to the container

func (*Registry) GetService

func (r *Registry) GetService(service interface{}) (err error)

GetService a service from the container

func (*Registry) HasService

func (r *Registry) HasService(service interface{}) (hasService bool)

HasService check if the service exists in the container

func (*Registry) Log added in v0.6.0

func (r *Registry) Log(err error, level log.Level)

Log to the registered logger service. Does not do anything if no log.Logger is registered.

Jump to

Keyboard shortcuts

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