miabase

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 15 Imported by: 0

README

miabase

Simplify building Mia-Platform custom plugins in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadEnv

func LoadEnv(c []configlib.EnvConfig, env interface{})

Types

type Plugin

type Plugin struct {
	Path string
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(path string) *Plugin

func (*Plugin) AddRoute

func (p *Plugin) AddRoute(method, path string, handler http.HandlerFunc)

type Service

type Service struct {
	Name    string
	Version string

	Logger         *zerolog.Logger
	HealthHandler  http.HandlerFunc
	ReadyHandler   http.HandlerFunc
	CheckupHandler http.HandlerFunc
	// contains filtered or unexported fields
}

func NewService

func NewService(name, version, logLevel string) *Service

func (*Service) Register

func (s *Service) Register(plugin *Plugin)

func (*Service) Start

func (s *Service) Start(httpPort int)

Start launch the configured service, mounting customized plugin and starting the webserver

func (*Service) Stop

func (s *Service) Stop()

Directories

Path Synopsis
examples
service command
pkg

Jump to

Keyboard shortcuts

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