deliverer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTLSConfig *tls.Config = nil

Functions

This section is empty.

Types

type ACL added in v1.0.0

type ACL struct {
	IP     []netip.Addr
	CIDR   []netip.Prefix
	Domain []Domain
}

func NewACL added in v1.0.0

func NewACL(opts AclOptions) *ACL

func (*ACL) Allow added in v1.0.0

func (acl *ACL) Allow(host string, addr netip.Addr) bool

type AclDecision added in v1.0.0

type AclDecision struct {
	Denied bool
}

type AclOptions added in v1.0.0

type AclOptions struct {
	Rules []string
}

type Deliverer

type Deliverer interface {
	Send(ctx context.Context, request *Request) (res *Response)
}

type Domain added in v1.0.0

type Domain string

func (Domain) Match added in v1.0.0

func (d Domain) Match(host string) bool

type HTTPDeliverer

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

HTTPDeliverer delivers via HTTP

func NewHTTPDeliverer

func NewHTTPDeliverer(opts Options) *HTTPDeliverer

func (*HTTPDeliverer) Send added in v1.0.1

func (d *HTTPDeliverer) Send(ctx context.Context, request *Request) *Response

func (*HTTPDeliverer) Setup added in v1.0.1

func (d *HTTPDeliverer) Setup() error

type Options added in v1.0.0

type Options struct {
	Logger         *zap.SugaredLogger
	RequestTimeout time.Duration
	AclOptions     *AclOptions
	ProxyOptions   *ProxyOptions
}

type ProxyOptions added in v1.0.0

type ProxyOptions struct {
	URL              string
	TLSCert          string
	TLSKey           string
	TLSCaCertificate string
	TLSVerify        bool
}

type Request

type Request struct {
	Request *http.Request
	Body    []byte
	Timeout time.Duration
}

type Resolver added in v1.0.0

type Resolver interface {
	LookupNetIP(ctx context.Context, network, host string) ([]netip.Addr, error)
}
var DefaultResolver Resolver = net.DefaultResolver

type Response

type Response struct {
	Request         *Request
	ACL             AclDecision
	StatusCode      int
	Header          http.Header
	ResponseBody    []byte
	Error           error
	Latancy         time.Duration
	ProxyStatusCode int
}

func (*Response) Is2xx

func (r *Response) Is2xx() bool

func (*Response) String

func (r *Response) String() string

Jump to

Keyboard shortcuts

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