http

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const HTTP_REQUEST object.Type = "http_request"
View Source
const HTTP_RESPONSE object.Type = "http_response"

Variables

This section is empty.

Functions

func Builtins

func Builtins() map[string]object.Object

func Fetch

func Fetch(ctx context.Context, args ...object.Object) object.Object

func MethodCmd

func MethodCmd(method string) object.BuiltinFunction

func Module

func Module() *object.Module

func NewHTTPClientFromParams

func NewHTTPClientFromParams(params *object.Map) (*http.Client, error)

func NewHttpRequest

func NewHttpRequest(ctx context.Context, args ...object.Object) object.Object

Types

type HttpRequest

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

func NewRequestFromParams

func NewRequestFromParams(url string, params *object.Map) (*HttpRequest, *object.Error)

func (*HttpRequest) AddCookie

func (r *HttpRequest) AddCookie(name string, cookie *object.Map) *object.Error

func (*HttpRequest) AddHeader

func (r *HttpRequest) AddHeader(name string, v object.Object)

func (*HttpRequest) AddHeaders

func (r *HttpRequest) AddHeaders(headers *object.Map)

func (*HttpRequest) ContentLength

func (r *HttpRequest) ContentLength() *object.Int

func (*HttpRequest) Cost

func (r *HttpRequest) Cost() int

func (*HttpRequest) Equals

func (r *HttpRequest) Equals(other object.Object) object.Object

func (*HttpRequest) GetAttr

func (r *HttpRequest) GetAttr(name string) (object.Object, bool)

func (*HttpRequest) Header

func (r *HttpRequest) Header() *object.Map

func (*HttpRequest) Inspect

func (r *HttpRequest) Inspect() string

func (*HttpRequest) Interface

func (r *HttpRequest) Interface() interface{}

func (*HttpRequest) IsTruthy

func (r *HttpRequest) IsTruthy() bool

func (*HttpRequest) RunOperation

func (r *HttpRequest) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*HttpRequest) Send

func (r *HttpRequest) Send(ctx context.Context) object.Object

func (*HttpRequest) SetAttr

func (r *HttpRequest) SetAttr(name string, value object.Object) error

func (*HttpRequest) SetBody

func (r *HttpRequest) SetBody(bodyObj object.Object) *object.Error

func (*HttpRequest) SetData

func (r *HttpRequest) SetData(dataObj object.Object) *object.Error

func (*HttpRequest) SetParams

func (r *HttpRequest) SetParams(params *object.Map)

func (*HttpRequest) Type

func (r *HttpRequest) Type() object.Type

func (*HttpRequest) URL

func (r *HttpRequest) URL() *object.String

type HttpResponse

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

func NewHttpResponse

func NewHttpResponse(resp *http.Response, timeout time.Duration, readerLimit int64) *HttpResponse

func (*HttpResponse) AsReader

func (r *HttpResponse) AsReader() (io.Reader, *object.Error)

func (*HttpResponse) Close

func (r *HttpResponse) Close()

func (*HttpResponse) ContentLength

func (r *HttpResponse) ContentLength() *object.Int

func (*HttpResponse) Cookies

func (r *HttpResponse) Cookies() *object.Map

func (*HttpResponse) Cost

func (r *HttpResponse) Cost() int

func (*HttpResponse) Equals

func (r *HttpResponse) Equals(other object.Object) object.Object

func (*HttpResponse) GetAttr

func (r *HttpResponse) GetAttr(name string) (object.Object, bool)

func (*HttpResponse) Header

func (r *HttpResponse) Header() *object.Map

func (*HttpResponse) Inspect

func (r *HttpResponse) Inspect() string

func (*HttpResponse) Interface

func (r *HttpResponse) Interface() interface{}

func (*HttpResponse) IsTruthy

func (r *HttpResponse) IsTruthy() bool

func (*HttpResponse) JSON

func (r *HttpResponse) JSON() object.Object

func (*HttpResponse) MarshalJSON

func (r *HttpResponse) MarshalJSON() ([]byte, error)

func (*HttpResponse) Proto

func (r *HttpResponse) Proto() *object.String

func (*HttpResponse) RunOperation

func (r *HttpResponse) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*HttpResponse) SetAttr

func (r *HttpResponse) SetAttr(name string, value object.Object) error

func (*HttpResponse) Status

func (r *HttpResponse) Status() *object.String

func (*HttpResponse) StatusCode

func (r *HttpResponse) StatusCode() *object.Int

func (*HttpResponse) Text

func (r *HttpResponse) Text() object.Object

func (*HttpResponse) Type

func (r *HttpResponse) Type() object.Type

Jump to

Keyboard shortcuts

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