snorlax

package module
v0.5.1-0...-b51f167 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

README

pikago-fetch

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	/*
		full uri like ganangxcoding.com/code-for/betterworld
	*/
	Uri string
	/*
		method supported like GET, POST, DELETE, PUT, PATCH
	*/
	Method string

	/*
		fill body with object or struct json type
	*/
	Body interface{}

	/* timout in secod default is application/json */
	ContentType string
	/* map your header */
	Header map[string]string

	/* with proxy url */
	WithProxy string

	/* ignore ssl certification? */
	WithForceSSL bool

	/* timout in secod default is 25 second */
	Timeout time.Duration
}

type Fetch

type Fetch struct {
	/* show error all */
	Error      error
	ErrorDebug error
	// contains filtered or unexported fields
}

func NewFetch

func NewFetch() *Fetch

func (*Fetch) Catch

func (o *Fetch) Catch(object interface{}) *Fetch

generate body response, should Fetch() first

func (*Fetch) CatchOther

func (o *Fetch) CatchOther() (res Response)

func (*Fetch) Fetch

func (o *Fetch) Fetch(ctx context.Context, c Config) *Fetch

type Response

type Response struct {
	Header http.Header
	Code   int
}

Jump to

Keyboard shortcuts

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