backend

package
v0.0.0-...-409fb91 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanRes

type ChanRes struct {
	// contains filtered or unexported fields
}

func (ChanRes) String

func (cr ChanRes) String() string

type Client

type Client struct {
	URL        *url.URL
	HTTPClient *http.Client
	Headers    *[]Header
	Logger     *log.Logger
	ReqNo      int
}

func NewClient

func NewClient(urlStr string, addHeaders *[]Header, insecure bool, logger *log.Logger) (*Client, error)

func (*Client) Do

func (c *Client) Do(req Request) *Res
type Header struct {
	Key   string
	Value string
}

func NewHeader

func NewHeader(key, val string) *Header

type Request

type Request struct {
	Ctx         context.Context
	Method      string
	Path        string
	Params      interface{}
	JsonRequest bool
	Out         interface{}
	Timeout     int
}

type Res

type Res struct {
	ReqNo      int
	StatusCode int
	StartTime  time.Time
	EndTime    time.Time
	Err        error
	Request    *http.Request
	Response   *http.Response
	Out        interface{}
}

func (Res) String

func (res Res) String() string

func (*Res) ValidStatus

func (res *Res) ValidStatus() bool

Jump to

Keyboard shortcuts

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