proxy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory added in v0.0.5

type Factory struct {
	// contains filtered or unexported fields
}

func NewProxyFactory

func NewProxyFactory(options ...FactoryOption) *Factory

func (*Factory) GetFirstInstance added in v0.0.5

func (pf *Factory) GetFirstInstance(realName string, realInstance interface{},
	proxys ...func() interface{}) interface{}

GetFirstInstance implement init mul level proxy, RealInstance and proxys make sure both implement the same interface return firstProxy | realInstance.

func (*Factory) GetInstances added in v0.0.5

func (pf *Factory) GetInstances(realName string, proxys ...func() interface{}) []interface{}

type FactoryOption added in v0.0.5

type FactoryOption func(c *Factory)

func WithLogger added in v0.1.2

func WithLogger(logger log.Logger) FactoryOption

type Proxy

type Proxy interface {
	// set next proxy.
	NextProxy(proxy interface{})

	// get proxy name.
	ProxyName() string
}

Jump to

Keyboard shortcuts

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