exchange

package
v0.0.0-...-b511e1a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: BSD-3-Clause Imports: 15 Imported by: 2

Documentation

Index

Examples

Constants

View Source
const (
	PkgPath = "github/advanced-go/core/exchange"
)

Variables

This section is empty.

Functions

func DeadlineExceededError

func DeadlineExceededError(t any) bool

func Do

func Do(req *http.Request) (resp *http.Response, status *runtime.Status)

Do - process a request, checking for overrides of file://, and a registered controller.

func Get

func Get(ctx context.Context, uri string, h http.Header) (resp *http.Response, status *runtime.Status)

Get - process an HTTP Get request

Example
package main

import (
	"fmt"
	"github.com/advanced-go/core/runtime"
)

const (
	testLocation = "github/advanced-go/core/exchange:ExampleGet"
)

func main() {
	runtime.SetOutputFormatter()
	var e runtime.Output
	r, status := Get(nil, "", nil)

	e.Handle(status, "123-456")
	fmt.Printf("test: Get(\"\") -> [resp:%v] [status:%v]\n", r.Status, status)

}
Output:

test: Get("") -> [resp:Internal Error] [status:Bad Request [error: URI is empty]]

func Http

func Http(ctx context.Context, method, url string, h http.Header, body io.Reader) (*http.Response, *runtime.Status)

Types

This section is empty.

Jump to

Keyboard shortcuts

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