Versions in this module Expand all Collapse all v0 v0.3.0 Jun 11, 2023 Changes in this version + func ParseSetCookie(cookies ...string) []*http.Cookie v0.2.0 May 12, 2023 Changes in this version + const XFromCache + var ErrAliasRecursive = errors.New("alias can't be recursive") + var ErrInvalidAction = errors.New("invalid action") + var ErrInvalidSchema = errors.New("invalid schema") + var ErrInvalidStep = errors.New("invalid step") + func Analyze(ctx *plugin.Context, s *Schema, content string) any + func CookieToString(cookies []*http.Cookie) string + func EmptyOr(value, defaultValue []T) []T + func GetElement(act Action, ctx *plugin.Context, content any) (string, error) + func GetElements(act Action, ctx *plugin.Context, content any) ([]string, error) + func GetString(act Action, ctx *plugin.Context, content any) (string, error) + func GetStrings(act Action, ctx *plugin.Context, content any) ([]string, error) + func IsFromCache(res *http.Response) bool + func MustResolve() T + func MustResolveNamed(name string) T + func Override(value T) bool + func OverrideLazy(initFunc func() (T, error)) bool + func OverrideNamed(name string, value any) (ok bool) + func ParseCookie(cookies string) []*http.Cookie + func Provide(value T) bool + func ProvideLazy(initFunc func() (T, error)) bool + func ProvideNamed(name string, value any) (ok bool) + func Resolve() (T, error) + func ResolveNamed(name string) (value T, err error) + func SetFormatter(formatHandler FormatHandler) + func ZeroOr(value, defaultValue T) T + type Action interface + Left func() Action + Right func() Action + type And struct + func NewAnd(left, right Action) *And + func (a And) Left() Action + func (a And) MarshalYAML() (any, error) + func (a And) Right() Action + func (a And) String() string + type Cache interface + Del func(key string) + Get func(key string) ([]byte, bool) + Set func(key string, value []byte) + SetWithTimeout func(key string, value []byte, timeout time.Duration) + func NewCache() Cache + type Cookie interface + CookieString func(u *url.URL) string + DeleteCookie func(u *url.URL) + SetCookieString func(u *url.URL, cookies string) + func NewCookie() Cookie + type Fetch interface + Do func(*http.Request) (*http.Response, error) + type FormatHandler interface + Format func(data any, format Type) (any, error) + func GetFormatter() FormatHandler + type Operator string + const OperatorAnd + const OperatorOr + type Or struct + func NewOr(left, right Action) *Or + func (a Or) Left() Action + func (a Or) MarshalYAML() (any, error) + func (a Or) Right() Action + func (a Or) String() string + type Property map[string]Schema + type Schema struct + Format Type + Init Action + Properties Property + Rule Action + Type Type + func NewSchema(types ...Type) *Schema + func (schema *Schema) AddProperty(field string, s Schema) *Schema + func (schema *Schema) CloneWithType(typ Type) *Schema + func (schema *Schema) SetInit(action Action) *Schema + func (schema *Schema) SetProperty(m Property) *Schema + func (schema *Schema) SetRule(action Action) *Schema + func (schema *Schema) UnmarshalText(text []byte) error + func (schema *Schema) UnmarshalYAML(node *yaml.Node) (err error) + func (schema Schema) MarshalText() ([]byte, error) + func (schema Schema) MarshalYAML() (any, error) + type Step struct + K string + V string + func (s Step) MarshalYAML() (any, error) + type Steps []Step + func NewSteps(str ...string) *Steps + func (s *Steps) Left() Action + func (s *Steps) Right() Action + func (s *Steps) UnmarshalYAML(value *yaml.Node) error + func (s Steps) MarshalYAML() (any, error) + type Type string + const ArrayType + const BooleanType + const IntegerType + const NumberType + const ObjectType + const StringType + func ToType(s any) (Type, error) v0.1.0-beta Apr 16, 2023