api

package
v0.0.0-...-6503e2e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockAPI

func MockAPI(wantedResult string) *httptest.Server

MockAPI create API mock

Types

type Request

type Request struct {
	Method  string
	URL     string
	Headers map[string]string
	Timeout time.Duration
	CB      *cb.CircuitBreaker
}

Request request config for http call Please be aware that timeout is Duration type i.e 4*time.Second or 100*time.Millisecond

func (*Request) Do

func (r *Request) Do() (buffer []byte, err error)

Do do http call

func (*Request) DoRequest

func (r *Request) DoRequest() (buffer []byte, err error)

DoRequest to do request

Jump to

Keyboard shortcuts

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