blackhole

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package blackhole is an outbound handler that blocks all connections.

Index

Constants

This section is empty.

Variables

View Source
var File_proxy_blackhole_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Config added in v1.1.0

type Config struct {
	Response *anypb.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated added in v1.1.0

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetInternalResponse added in v1.1.0

func (c *Config) GetInternalResponse() (ResponseConfig, error)

GetInternalResponse converts response settings from proto to internal data structure.

func (*Config) GetResponse added in v1.1.0

func (x *Config) GetResponse() *anypb.Any

func (*Config) ProtoMessage added in v1.1.0

func (*Config) ProtoMessage()

func (*Config) ProtoReflect added in v1.1.0

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset added in v1.1.0

func (x *Config) Reset()

func (*Config) String added in v1.1.0

func (x *Config) String() string

type HTTPResponse added in v1.1.0

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

func (*HTTPResponse) Descriptor deprecated added in v1.1.0

func (*HTTPResponse) Descriptor() ([]byte, []int)

Deprecated: Use HTTPResponse.ProtoReflect.Descriptor instead.

func (*HTTPResponse) ProtoMessage added in v1.1.0

func (*HTTPResponse) ProtoMessage()

func (*HTTPResponse) ProtoReflect added in v1.1.0

func (x *HTTPResponse) ProtoReflect() protoreflect.Message

func (*HTTPResponse) Reset added in v1.1.0

func (x *HTTPResponse) Reset()

func (*HTTPResponse) String added in v1.1.0

func (x *HTTPResponse) String() string

func (*HTTPResponse) WriteTo added in v1.1.0

func (*HTTPResponse) WriteTo(writer buf.Writer) int32

WriteTo implements ResponseConfig.WriteTo().

type Handler added in v1.1.0

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

Handler is an outbound connection that silently swallow the entire payload.

func New added in v1.1.0

func New(ctx context.Context, config *Config) (*Handler, error)

New creates a new blackhole handler.

func (*Handler) Process added in v1.1.0

func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error

Process implements OutboundHandler.Dispatch().

type NoneResponse added in v1.1.0

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

func (*NoneResponse) Descriptor deprecated added in v1.1.0

func (*NoneResponse) Descriptor() ([]byte, []int)

Deprecated: Use NoneResponse.ProtoReflect.Descriptor instead.

func (*NoneResponse) ProtoMessage added in v1.1.0

func (*NoneResponse) ProtoMessage()

func (*NoneResponse) ProtoReflect added in v1.1.0

func (x *NoneResponse) ProtoReflect() protoreflect.Message

func (*NoneResponse) Reset added in v1.1.0

func (x *NoneResponse) Reset()

func (*NoneResponse) String added in v1.1.0

func (x *NoneResponse) String() string

func (*NoneResponse) WriteTo added in v1.1.0

func (*NoneResponse) WriteTo(buf.Writer) int32

WriteTo implements ResponseConfig.WriteTo().

type ResponseConfig added in v1.1.0

type ResponseConfig interface {
	// WriteTo writes predefined response to the give buffer.
	WriteTo(buf.Writer) int32
}

ResponseConfig is the configuration for blackhole responses.

type SimplifiedConfig added in v1.1.0

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

func (*SimplifiedConfig) Descriptor deprecated added in v1.1.0

func (*SimplifiedConfig) Descriptor() ([]byte, []int)

Deprecated: Use SimplifiedConfig.ProtoReflect.Descriptor instead.

func (*SimplifiedConfig) ProtoMessage added in v1.1.0

func (*SimplifiedConfig) ProtoMessage()

func (*SimplifiedConfig) ProtoReflect added in v1.1.0

func (x *SimplifiedConfig) ProtoReflect() protoreflect.Message

func (*SimplifiedConfig) Reset added in v1.1.0

func (x *SimplifiedConfig) Reset()

func (*SimplifiedConfig) String added in v1.1.0

func (x *SimplifiedConfig) String() string

Jump to

Keyboard shortcuts

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