blackhole

package
v4.31.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

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.1

type Config struct {
	Response *serial.TypedMessage `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() *serial.TypedMessage

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 added in v1.17.1

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 added in v1.17.1

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 added in v1.17.1

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 added in v1.17.1

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.

Jump to

Keyboard shortcuts

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