Documentation ¶
Index ¶
- Constants
- func Builtins() map[string]object.Object
- func Fetch(ctx context.Context, args ...object.Object) object.Object
- func Handle(ctx context.Context, args ...object.Object) object.Object
- func HandlerFunc(fn *object.Function, callFunc object.CallFunc) http.Handler
- func ListenAndServe(ctx context.Context, args ...object.Object) object.Object
- func ListenAndServeTLS(ctx context.Context, args ...object.Object) object.Object
- func MethodCmd(method string) object.BuiltinFunction
- func Module(opts ...ModuleOpts) *object.Module
- func NewHTTPClientFromParams(params *object.Map) (*http.Client, error)
- func NewHttpRequest(ctx context.Context, args ...object.Object) object.Object
- type HttpRequest
- func (r *HttpRequest) AddCookie(name string, cookie *object.Map) *object.Error
- func (r *HttpRequest) AddHeader(name string, v object.Object)
- func (r *HttpRequest) AddHeaders(headers *object.Map)
- func (r *HttpRequest) ContentLength() *object.Int
- func (r *HttpRequest) Cost() int
- func (r *HttpRequest) Equals(other object.Object) object.Object
- func (r *HttpRequest) GetAttr(name string) (object.Object, bool)
- func (r *HttpRequest) Header() *object.Map
- func (r *HttpRequest) Inspect() string
- func (r *HttpRequest) Interface() interface{}
- func (r *HttpRequest) IsTruthy() bool
- func (r *HttpRequest) RunOperation(opType op.BinaryOpType, right object.Object) object.Object
- func (r *HttpRequest) Send(ctx context.Context) object.Object
- func (r *HttpRequest) SetAttr(name string, value object.Object) error
- func (r *HttpRequest) SetBody(bodyObj object.Object) *object.Error
- func (r *HttpRequest) SetData(dataObj object.Object) *object.Error
- func (r *HttpRequest) SetParams(params *object.Map)
- func (r *HttpRequest) Type() object.Type
- func (r *HttpRequest) URL() *object.String
- type HttpResponse
- func (r *HttpResponse) AsReader() (io.Reader, *object.Error)
- func (r *HttpResponse) Close()
- func (r *HttpResponse) ContentLength() *object.Int
- func (r *HttpResponse) Cookies() *object.Map
- func (r *HttpResponse) Cost() int
- func (r *HttpResponse) Equals(other object.Object) object.Object
- func (r *HttpResponse) GetAttr(name string) (object.Object, bool)
- func (r *HttpResponse) Header() *object.Map
- func (r *HttpResponse) Inspect() string
- func (r *HttpResponse) Interface() interface{}
- func (r *HttpResponse) IsTruthy() bool
- func (r *HttpResponse) JSON() object.Object
- func (r *HttpResponse) MarshalJSON() ([]byte, error)
- func (r *HttpResponse) Proto() *object.String
- func (r *HttpResponse) RunOperation(opType op.BinaryOpType, right object.Object) object.Object
- func (r *HttpResponse) SetAttr(name string, value object.Object) error
- func (r *HttpResponse) Status() *object.String
- func (r *HttpResponse) StatusCode() *object.Int
- func (r *HttpResponse) Text() object.Object
- func (r *HttpResponse) Type() object.Type
- type ModuleOpts
- type ResponseWriter
- func (w *ResponseWriter) AddHeader(key, value string)
- func (w *ResponseWriter) Cost() int
- func (w *ResponseWriter) DelHeader(key string)
- func (w *ResponseWriter) Equals(other object.Object) object.Object
- func (w *ResponseWriter) GetAttr(name string) (object.Object, bool)
- func (w *ResponseWriter) Inspect() string
- func (w *ResponseWriter) Interface() interface{}
- func (w *ResponseWriter) IsTruthy() bool
- func (w *ResponseWriter) RunOperation(opType op.BinaryOpType, right object.Object) object.Object
- func (w *ResponseWriter) SetAttr(name string, value object.Object) error
- func (w *ResponseWriter) Type() object.Type
- func (w *ResponseWriter) Write(obj object.Object) (int, error)
- func (w *ResponseWriter) WriteHeader(statusCode int)
Constants ¶
View Source
const HTTP_REQUEST object.Type = "http_request"
View Source
const HTTP_RESPONSE object.Type = "http_response"
View Source
const RESPONSE_WRITER object.Type = "http.response_writer"
Variables ¶
This section is empty.
Functions ¶
func HandlerFunc ¶ added in v1.4.0
func ListenAndServe ¶ added in v1.4.0
func ListenAndServeTLS ¶ added in v1.4.0
func MethodCmd ¶
func MethodCmd(method string) object.BuiltinFunction
func Module ¶
func Module(opts ...ModuleOpts) *object.Module
func NewHTTPClientFromParams ¶
Types ¶
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
func NewRequest ¶ added in v1.4.0
func NewRequest(r *http.Request) *HttpRequest
func NewRequestFromParams ¶
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) 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) 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 (*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) 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
type ModuleOpts ¶ added in v1.4.0
type ModuleOpts struct {
ListenersAllowed bool
}
type ResponseWriter ¶ added in v1.4.0
type ResponseWriter struct {
// contains filtered or unexported fields
}
func NewResponseWriter ¶ added in v1.4.0
func NewResponseWriter(w http.ResponseWriter) *ResponseWriter
func (*ResponseWriter) AddHeader ¶ added in v1.4.0
func (w *ResponseWriter) AddHeader(key, value string)
func (*ResponseWriter) Cost ¶ added in v1.4.0
func (w *ResponseWriter) Cost() int
func (*ResponseWriter) DelHeader ¶ added in v1.4.0
func (w *ResponseWriter) DelHeader(key string)
func (*ResponseWriter) Equals ¶ added in v1.4.0
func (w *ResponseWriter) Equals(other object.Object) object.Object
func (*ResponseWriter) GetAttr ¶ added in v1.4.0
func (w *ResponseWriter) GetAttr(name string) (object.Object, bool)
func (*ResponseWriter) Inspect ¶ added in v1.4.0
func (w *ResponseWriter) Inspect() string
func (*ResponseWriter) Interface ¶ added in v1.4.0
func (w *ResponseWriter) Interface() interface{}
func (*ResponseWriter) IsTruthy ¶ added in v1.4.0
func (w *ResponseWriter) IsTruthy() bool
func (*ResponseWriter) RunOperation ¶ added in v1.4.0
func (w *ResponseWriter) RunOperation(opType op.BinaryOpType, right object.Object) object.Object
func (*ResponseWriter) SetAttr ¶ added in v1.4.0
func (w *ResponseWriter) SetAttr(name string, value object.Object) error
func (*ResponseWriter) Type ¶ added in v1.4.0
func (w *ResponseWriter) Type() object.Type
func (*ResponseWriter) Write ¶ added in v1.4.0
func (w *ResponseWriter) Write(obj object.Object) (int, error)
func (*ResponseWriter) WriteHeader ¶ added in v1.4.0
func (w *ResponseWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.