go-micro-plugins

module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT

README

go-micro-plugins

Build Status codecov

A repository for go-micro protocol one plugins.

Overview

Micro tooling is built on a powerful pluggable architecture. Plugins can be swapped out with zero code changes. This repository contains plugins for all micro related tools. Read on for further info.

Contents

Contents of this repository:

Directory Description
Wrappers Prometheus

Usage

Plugins can be added to go-micro in the following ways. By doing so they'll be available to set via command line args or environment variables.

Import the plugins in a Go program then call service.Init to parse the command line and environment variables.

import (
	"github.com/micro/go-micro"
	prometheus_plugin "github.com/ProtocolONE/go-micro-plugins/wrapper/monitoring/prometheus"
)

func main() {
	service := micro.NewService(
		// Set service name
		micro.Name("my.service"),
		
		// Register wrapper
		micro.WrapHandler(prometheus_plugin.NewHandlerWrapper((*proto.MyServiceInterface)(nil))),		
	)

	// Parse CLI flags
	service.Init()
}

Directories

Path Synopsis
wrapper

Jump to

Keyboard shortcuts

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