endpoint

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

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