blackhole

package
v5.57.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 15 Imported by: 5 modules, 6 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.

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

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

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetInternalResponse

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

GetInternalResponse converts response settings from proto to internal data structure.

func (*Config) GetResponse

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

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

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

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type HTTPResponse

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

func (*HTTPResponse) Descriptor deprecated

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

Deprecated: Use HTTPResponse.ProtoReflect.Descriptor instead.

func (*HTTPResponse) ProtoMessage

func (*HTTPResponse) ProtoMessage()

func (*HTTPResponse) ProtoReflect

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

func (*HTTPResponse) Reset

func (x *HTTPResponse) Reset()

func (*HTTPResponse) String

func (x *HTTPResponse) String() string

func (*HTTPResponse) WriteTo

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

WriteTo implements ResponseConfig.WriteTo().

type Handler

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

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

func New

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

New creates a new blackhole handler.

func (*Handler) Process

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

Process implements OutboundHandler.Dispatch().

type NoneResponse

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

func (*NoneResponse) Descriptor deprecated

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

Deprecated: Use NoneResponse.ProtoReflect.Descriptor instead.

func (*NoneResponse) ProtoMessage

func (*NoneResponse) ProtoMessage()

func (*NoneResponse) ProtoReflect

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

func (*NoneResponse) Reset

func (x *NoneResponse) Reset()

func (*NoneResponse) String

func (x *NoneResponse) String() string

func (*NoneResponse) WriteTo

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

WriteTo implements ResponseConfig.WriteTo().

type ResponseConfig

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

ResponseConfig is the configuration for blackhole responses.

type SimplifiedConfig

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

func (*SimplifiedConfig) Descriptor deprecated

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

Deprecated: Use SimplifiedConfig.ProtoReflect.Descriptor instead.

func (*SimplifiedConfig) ProtoMessage

func (*SimplifiedConfig) ProtoMessage()

func (*SimplifiedConfig) ProtoReflect

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

func (*SimplifiedConfig) Reset

func (x *SimplifiedConfig) Reset()

func (*SimplifiedConfig) String

func (x *SimplifiedConfig) String() string

Jump to

Keyboard shortcuts

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