request

package
v0.0.0-...-d62e3dc Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 30 * time.Second
)

Variables

View Source
var (
	ErrOnPrepareResultMustNotNil = errors.New("http request must not nil")
	ErrOnCompletedMustNotNil     = errors.New("http request on completed must not nil")
)

Functions

This section is empty.

Types

type ID

type ID = uint64

type Manager

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

func NewManager

func NewManager(rootContext *sadefine.RootContext, pid *sadefine.PID, logger slog.ILogger) *Manager

func (*Manager) Request

func (m *Manager) Request(timeout time.Duration, tag Tag, onPrepare OnPrepareFunc, onCompletedFunc OnCompletedFunc) (id ID, err error)

type OnCompletedFunc

type OnCompletedFunc func(err error, req *Request, ctx sadefine.Context)

type OnPrepareFunc

type OnPrepareFunc func() (req *http.Request, err error)

type Request

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

func (Request) GetResponseBodyData

func (r Request) GetResponseBodyData() (body []byte, err error)

func (Request) ID

func (r Request) ID() ID

func (Request) Request

func (r Request) Request() *http.Request

func (Request) Response

func (r Request) Response() *http.Response

func (Request) Tag

func (r Request) Tag() Tag

type Tag

type Tag = uint64

Jump to

Keyboard shortcuts

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