microservice

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 20 Imported by: 3

README

micro-service

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunService

func RunService(ss ...ServiceHandler)

func WithAPI added in v0.3.0

func WithAPI(apis ...apitool.GinAPI) options

func WithErrorHandler added in v0.3.0

func WithErrorHandler(errHandler err.GinServiceErrorHandler) options

func WithMiddle added in v0.3.0

func WithMiddle(mids ...mid.GinMiddle) options

func WithPromhttp added in v0.3.0

func WithPromhttp(c ...prometheus.Collector) options

Types

type MicroService

type MicroService[T cfg.ModelCfg, R di.ServiceDI] interface {
	GetModelCfgMgr() cfg.ModelCfgMgr
	GetDI() R
	NewLog(name string) (log.Logger, error)
	NewCfg(name string) (T, error)
}

func New added in v0.0.4

func New[T cfg.ModelCfg, R di.ServiceDI](mycfg T, mydi R) (MicroService[T, R], error)

type ServiceHandler

type ServiceHandler func(ctx context.Context)

func NewApiWithViper added in v0.3.0

func NewApiWithViper(opts ...options) (ServiceHandler, error)

Directories

Path Synopsis
err
mid

Jump to

Keyboard shortcuts

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