connection

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotReadyError = errors.New("not ready")

Functions

This section is empty.

Types

type Connection

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

Connection defines a connection

func New

func New(options ...Option) *Connection

New constructs a new instance of HTTPPool

func (*Connection) Close

func (c *Connection) Close() (err error)

Close will close connections

func (*Connection) Connect

func (c *Connection) Connect() (err error)

Connect will connect

func (*Connection) Get

func (c *Connection) Get(urlToGet string) (resp *http.Response, err error)

Get will get a URL

func (*Connection) PublicIP

func (c *Connection) PublicIP() string

PublicIP returns the current public IP address, getting it if hasn't been set

type Option

type Option func(c *Connection)

Option is the type all options need to adhere to

func OptionDebug

func OptionDebug(debug bool) Option

OptionDebug turns on debugging

func OptionHeaders

func OptionHeaders(headers map[string]string) Option

OptionDebug turns on debugging

func OptionName

func OptionName(name string) Option

OptionName turns on debugging

func OptionTimeout

func OptionTimeout(timeout time.Duration) Option

OptionTimeout sets timeout

func OptionUseTor

func OptionUseTor(usetor bool) Option

OptionUseTor turns on debugging

Jump to

Keyboard shortcuts

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