netclient

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = logging.Logger

Functions

func NewNetworkClient

func NewNetworkClient(ctx ftp_context.Context) (cl *http.Client, err log_item.LogErr)

Types

type NetworkEngine

type NetworkEngine struct {
	sync.Mutex
	Client *http.Client
	Map    ftp_base.MutexedMap[*http.Response]
	// contains filtered or unexported fields
}

func NewNetworkEngine

func NewNetworkEngine(client *http.Client, base_url string) *NetworkEngine

func (*NetworkEngine) BaseUrl

func (ne *NetworkEngine) BaseUrl() string

func (*NetworkEngine) GetCookie

func (ne *NetworkEngine) GetCookie(route string, cookie_name string) (cookie *http.Cookie, err error)

func (*NetworkEngine) GetCookies

func (ne *NetworkEngine) GetCookies(route string) (cookies []*http.Cookie, err error)

func (*NetworkEngine) GetJson

func (ne *NetworkEngine) GetJson(route string, out_json_item any) (err error)

func (*NetworkEngine) Ping

func (ne *NetworkEngine) Ping(ping_url string, tries int, v ...*map[string]any) error

func (*NetworkEngine) PostBytes

func (ne *NetworkEngine) PostBytes(route string, data []byte, out_json_item any) (err error)

func (*NetworkEngine) PostJson

func (ne *NetworkEngine) PostJson(route string, in_json_item any, out_json_item any) (err error)

func (*NetworkEngine) SetCookie

func (ne *NetworkEngine) SetCookie(route string, cookies ...*http.Cookie) error

Jump to

Keyboard shortcuts

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