cloud

package
v0.0.0-...-a79fb06 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

This package holds http client wrapper for cloud access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackgroundMetric

func BackgroundMetric(kind, name, value string)

func Download

func Download(url, filename string) error

func EnsureHttps

func EnsureHttps(endpoint string) (string, error)

func ReadFile

func ReadFile(resource string) ([]byte, error)

func WaitTelemetry

func WaitTelemetry()

Types

type Client

type Client interface {
	Endpoint() string
	NewRequest(string) *Request
	Head(request *Request) *Response
	Get(request *Request) *Response
	Post(request *Request) *Response
	Put(request *Request) *Response
	Delete(request *Request) *Response
	NewClient(endpoint string) (Client, error)
	WithTimeout(time.Duration) Client
	WithTracing() Client
	Uncritical() Client
}

func NewClient

func NewClient(endpoint string) (Client, error)

func NewUnsafeClient

func NewUnsafeClient(endpoint string) (Client, error)

type Request

type Request struct {
	Url              string
	Headers          map[string]string
	TransferEncoding string
	ContentLength    int64
	Body             io.Reader
	Stream           io.Writer
}

type Response

type Response struct {
	Status  int
	Err     error
	Body    []byte
	Elapsed common.Duration
}

Jump to

Keyboard shortcuts

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