Documentation ¶
Index ¶
- type AliasPlugin
- func (p *AliasPlugin) Alias(aliasServicePath, aliasServiceMethod string, servicePath, serviceMethod string)
- func (p *AliasPlugin) PostReadRequest(ctx context.Context, r *protocol.Message, e error) error
- func (p *AliasPlugin) PreWriteResponse(ctx context.Context, r *protocol.Message, res *protocol.Message) error
- type BlacklistPlugin
- type TeeConnPlugin
- type WhitelistPlugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliasPlugin ¶
AliasPlugin can be used to set aliases for services
func NewAliasPlugin ¶
func NewAliasPlugin() *AliasPlugin
NewAliasPlugin creates a new NewAliasPlugin
func (*AliasPlugin) Alias ¶
func (p *AliasPlugin) Alias(aliasServicePath, aliasServiceMethod string, servicePath, serviceMethod string)
Alias sets a alias for the serviceMethod. For example Alias("anewpath&method", "Arith.mul")
func (*AliasPlugin) PostReadRequest ¶
PostReadRequest converts the alias of this service.
func (*AliasPlugin) PreWriteResponse ¶
func (p *AliasPlugin) PreWriteResponse(ctx context.Context, r *protocol.Message, res *protocol.Message) error
PreWriteResponse restore servicePath and serviceMethod.
type BlacklistPlugin ¶
type BlacklistPlugin struct { Blacklist map[string]bool BlacklistMask []*net.IPNet // net.ParseCIDR("172.17.0.0/16") to get *net.IPNet }
BlacklistPlugin is a plugin that control only ip addresses in blacklist can **NOT** access services.
func (*BlacklistPlugin) HandleConnAccept ¶
HandleConnAccept check ip.
type TeeConnPlugin ¶
type TeeConnPlugin struct {
// contains filtered or unexported fields
}
TeeConnPlugin is a plugin that copy requests from clients and send to a io.Writer.
func NewTeeConnPlugin ¶
func NewTeeConnPlugin(w io.Writer) *TeeConnPlugin
func (*TeeConnPlugin) HandleConnAccept ¶
HandleConnAccept check ip.
func (*TeeConnPlugin) Update ¶
func (plugin *TeeConnPlugin) Update(w io.Writer)
Update can start a stream copy by setting a non-nil w. If you set a nil w, it doesn't copy stream.
type WhitelistPlugin ¶
type WhitelistPlugin struct { Whitelist map[string]bool WhitelistMask []*net.IPNet // net.ParseCIDR("172.17.0.0/16") to get *net.IPNet }
WhitelistPlugin is a plugin that control only ip addresses in whitelist can access services.
func (*WhitelistPlugin) HandleConnAccept ¶
HandleConnAccept check ip.