rest

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionDelimiter = ":"
	IdParameter     = "/^id"
	IdPathParameter = "/*id"
)

Variables

View Source
var (
	TlsConfig = &tls.Config{
		InsecureSkipVerify: true,
	}
	HttpControlTransport = &httpcontrol.Transport{

		DisableKeepAlives:   false,
		MaxIdleConnsPerHost: Config().TransportMaxIdleConns,
		RequestTimeout:      Config().TransportRequestTimeout * time.Second,
		MaxTries:            Config().TransportMaxTries,
		TLSClientConfig:     TlsConfig,
	}
)

Functions

func Do

func Do(request *http.Request) (body []byte, response *http.Response, err *resource.Status)

Types

type Configuration

type Configuration struct {
	HostAndPort             string        `default:":8080"`
	BasePath                string        `default:"/obolary/1.0"`
	TransportMaxIdleConns   int           `default:"256"`
	TransportMaxTries       uint          `default:"3"`
	TransportRequestTimeout time.Duration `default:"60"`
}

func Config

func Config() *Configuration

type Context

type Context struct {
	URL         string
	AccessToken string
	ContentType string
}

Jump to

Keyboard shortcuts

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