uadguard

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRetries = 3
	DefaultTimeout = 1 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorRsp

type ErrorRsp struct {
	Message string `json:"message"`
}

type FilteringStatusRsp

type FilteringStatusRsp struct {
	Rules []string `json:"user_rules"`
}

type Option

type Option func(*Upstream)

func WithAutoPTR

func WithAutoPTR(enabled bool) Option

func WithBasicAuth

func WithBasicAuth(login, password string) Option

func WithDebug

func WithDebug(verbose bool) Option

func WithUpstream

func WithUpstream(upstream string) Option

type Tx

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

func (*Tx) Append

func (t *Tx) Append(r upstream.Rule) error

func (*Tx) Close

func (t *Tx) Close()

func (*Tx) Commit

func (t *Tx) Commit(ctx context.Context) error

func (*Tx) Delete

func (t *Tx) Delete(r upstream.Rule) error

type Upstream

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

func NewUpstream

func NewUpstream(opts ...Option) (*Upstream, error)

func NewUpstreamWithHTTP

func NewUpstreamWithHTTP(httpc *http.Client, opts ...Option) (*Upstream, error)

func (*Upstream) Query

func (c *Upstream) Query(ctx context.Context, r upstream.Rule) ([]upstream.Rule, error)

func (*Upstream) Tx

func (c *Upstream) Tx(ctx context.Context) (upstream.Tx, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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