thoth

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func With

func With(ctx context.Context, cli *Client) context.Context

Types

type ASNChecker

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

func (*ASNChecker) Check

func (asnc *ASNChecker) Check(r *http.Request) (bool, error)

func (*ASNChecker) Hash

func (asnc *ASNChecker) Hash() string

type Client

type Client struct {
	IPToASN iptoasnv1.IpToASNServiceClient
	// contains filtered or unexported fields
}

func FromContext

func FromContext(ctx context.Context) (*Client, bool)

func New

func New(ctx context.Context, thothURL, apiToken string, plaintext bool) (*Client, error)

func (*Client) ASNCheckerFor

func (c *Client) ASNCheckerFor(asns []uint32) checker.Impl

func (*Client) Close

func (c *Client) Close() error

func (*Client) GeoIPCheckerFor

func (c *Client) GeoIPCheckerFor(countries []string) checker.Impl

func (*Client) WithIPToASNService

func (c *Client) WithIPToASNService(impl iptoasnv1.IpToASNServiceClient)

type GeoIPChecker

type GeoIPChecker struct {
	IPToASN   iptoasnv1.IpToASNServiceClient
	Countries map[string]struct{}
	// contains filtered or unexported fields
}

func (*GeoIPChecker) Check

func (gipc *GeoIPChecker) Check(r *http.Request) (bool, error)

func (*GeoIPChecker) Hash

func (gipc *GeoIPChecker) Hash() string

type IPToASNWithCache

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

func (*IPToASNWithCache) Lookup

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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