endpoint

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Endpoint Wrapper

The endpoint wrapper is a function which allows you to execute a wrapper at a more granular level. At the moment client or handler wrappers are executed on any request method. The endpoint wrapper makes it much easier to specify exact methods to execute on otherwise acting as a pass through.

Usage

When creating your service, add the wrapper like so.

srv := micro.NewService(
	micro.Name("com.example.srv.foo"),
)

srv.Init(
	// cw is your client wrapper
	// hw is your handler wrapper
	// Foo.Bar and Foo.Baz are the methods to execute on
	micro.WrapClient(endpoint.NewClientWrapper(cw, "Foo.Bar", "Foo.Baz"))
	micro.WrapHandler(endpoint.NewHandlerWrapper(hw, "Foo.Bar", "Bar.Baz", "Debug.Health")),
)

Documentation

Overview

Package endpoint provides a wrapper that executes other wrappers for specific methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientWrapper

func NewClientWrapper(cw client.Wrapper, eps ...string) client.Wrapper

NewClientWrapper wraps another client wrapper but only executes when the endpoints specified are executed.

func NewHandlerWrapper

func NewHandlerWrapper(hw server.HandlerWrapper, eps ...string) server.HandlerWrapper

NewHandlerWrapper wraps another handler wrapper but only executes when the endpoints specified are executed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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