Documentation ¶
Index ¶
- Constants
- Variables
- func CloseAll(logger *zerolog.Logger, closers []io.Closer, msg string)
- func CollectFrames(ctx context.Context, receiver *values.Array, doc drivers.HTMLDocument) error
- func DeserializeStyles(input values.String) (*values.Object, error)
- func FromHTMLType(nt html.NodeType) int
- func GetInDocument(ctx context.Context, doc drivers.HTMLDocument, path []core.Value) (core.Value, error)
- func GetInElement(ctx context.Context, el drivers.HTMLElement, path []core.Value) (core.Value, error)
- func GetInNode(ctx context.Context, node drivers.HTMLNode, path []core.Value) (core.Value, error)
- func GetInPage(ctx context.Context, page drivers.HTMLPage, path []core.Value) (core.Value, error)
- func GetUserAgent(val string) string
- func IsAttribute(name string) bool
- func NewIterator(node drivers.HTMLElement) (core.Iterator, error)
- func PathToString(path []core.Value) string
- func SerializeStyles(_ context.Context, styles *values.Object) values.String
- func SetInDocument(ctx context.Context, doc drivers.HTMLDocument, path []core.Value, ...) error
- func SetInElement(ctx context.Context, el drivers.HTMLElement, path []core.Value, ...) error
- func SetInNode(_ context.Context, _ drivers.HTMLNode, path []core.Value, _ core.Value) error
- func SetInPage(ctx context.Context, page drivers.HTMLPage, path []core.Value, ...) error
- func ToHTMLType(input int) html.NodeType
- type AtomicValue
- type AtomicValueWriter
- type Iterator
- type LazyValue
- func (lv *LazyValue) Mutate(ctx context.Context, mutator func(v core.Value, err error))
- func (lv *LazyValue) MutateIfReady(mutator func(v core.Value, err error))
- func (lv *LazyValue) Read(ctx context.Context) (core.Value, error)
- func (lv *LazyValue) Ready() bool
- func (lv *LazyValue) Reload(ctx context.Context)
- func (lv *LazyValue) Reset()
- type LazyValueFactory
Constants ¶
const RandomUserAgent = "*"
Variables ¶
var ( ErrReadOnly = core.Error(core.ErrInvalidOperation, "read only") ErrInvalidPath = core.Error(core.ErrInvalidOperation, "invalid path") )
var Attributes = []string{}/* 135 elements not displayed */
Functions ¶
func CollectFrames ¶ added in v0.8.0
func DeserializeStyles ¶ added in v0.7.0
func FromHTMLType ¶ added in v0.8.0
func GetInDocument ¶ added in v0.7.0
func GetInElement ¶ added in v0.7.0
func GetUserAgent ¶
func IsAttribute ¶
func NewIterator ¶ added in v0.7.0
func NewIterator( node drivers.HTMLElement, ) (core.Iterator, error)
func PathToString ¶ added in v0.7.0
func SerializeStyles ¶ added in v0.7.0
func SetInDocument ¶ added in v0.7.0
func SetInElement ¶ added in v0.7.0
func ToHTMLType ¶
Types ¶
type AtomicValue ¶ added in v0.8.0
type AtomicValue struct {
// contains filtered or unexported fields
}
AtomicValue represents an atomic value
func NewAtomicValue ¶ added in v0.8.0
func NewAtomicValue(value core.Value) *AtomicValue
func (*AtomicValue) Read ¶ added in v0.8.0
func (av *AtomicValue) Read() core.Value
Read returns an underlying value. @returns (Value) - Underlying value
func (*AtomicValue) Write ¶ added in v0.8.0
func (av *AtomicValue) Write(writer AtomicValueWriter) error
Write sets a new underlying value. If writer fails, the operations gets terminated and an underlying value remains. @param (AtomicValueWriter) - Writer function that receives a current value and returns new one. @returns (Error) - Error if write operation failed
type AtomicValueWriter ¶ added in v0.8.0
AtomicValueWriter represents an atomic value writer
type LazyValue ¶
type LazyValue struct {
// contains filtered or unexported fields
}
LazyValue represents a value with late initialization
func NewLazyValue ¶
func NewLazyValue(factory LazyValueFactory) *LazyValue
func (*LazyValue) Mutate ¶ added in v0.8.0
Mutate safely mutates an underlying value. Loads a value if it's not ready. Thread safe.
func (*LazyValue) MutateIfReady ¶ added in v0.8.0
MutateIfReady safely mutates an underlying value only if it's ready.
func (*LazyValue) Read ¶
Read returns an underlying value. Not thread safe. Should not mutated. @returns (Value) - Underlying value if successfully loaded, otherwise error
func (*LazyValue) Ready ¶
Ready indicates whether the value is ready. @returns (Boolean) - Boolean value indicating whether the value is ready.