Documentation
¶
Overview ¶
Package hsruntime provides HTTPScript-specific program runtime context, such as config loading, cookie loading, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Globals scope.ScopedBindings Funcs *scope.FuncTable DefaultHost string HostAliasing HostAliasFn Client *http.Client }
func NewContext ¶
func NewContext() *Context
func NewDefaultContext ¶
NewDefaultContext returns a default setup of Context, binding standard funcs, loading config, etc.
type DeferredLoadCookieJar ¶ added in v0.1.5
type DeferredLoadCookieJar struct { LoadFn func() (http.CookieJar, error) // contains filtered or unexported fields }
DeferredLoadCookieJar is an http.CookieJar that only constructs its underlying jar (using LoadFn) on use.
func (*DeferredLoadCookieJar) Cookies ¶ added in v0.1.5
func (d *DeferredLoadCookieJar) Cookies(u *url.URL) []*http.Cookie
func (*DeferredLoadCookieJar) SetCookies ¶ added in v0.1.5
func (d *DeferredLoadCookieJar) SetCookies(u *url.URL, cookies []*http.Cookie)
type HostAliasFn ¶
HostAliasFn applies host aliasing rules, returning a new hostname (or "" if no aliasing is applied).
func ComposeHostAliasing ¶
func ComposeHostAliasing(base, next HostAliasFn) HostAliasFn
type SimpleHostAliases ¶
func (SimpleHostAliases) GetAlias ¶
func (sha SimpleHostAliases) GetAlias(hostname string) string
Click to show internal directories.
Click to hide internal directories.