common

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const RandomUserAgent = "*"

Variables

View Source
var Attributes = []string{}/* 135 elements not displayed */

Functions

func GetUserAgent

func GetUserAgent(val string) string

func IsAttribute

func IsAttribute(name string) bool

func ToHTMLType

func ToHTMLType(nt html.NodeType) int

Types

type LazyFactory

type LazyFactory func() (core.Value, error)

type LazyValue

type LazyValue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLazyValue

func NewLazyValue(factory LazyFactory) *LazyValue

func (*LazyValue) Read

func (lv *LazyValue) Read() (core.Value, error)

Read returns an underlying value. Not thread safe. Should not mutated. @returns (Value) - Underlying value if successfully loaded, otherwise error

func (*LazyValue) Ready

func (lv *LazyValue) Ready() bool

Ready indicates whether the value is ready. @returns (Boolean) - Boolean value indicating whether the value is ready.

func (*LazyValue) Reset

func (lv *LazyValue) Reset()

Reset resets the storage. Next call of Read will trigger the factory function again.

func (*LazyValue) Write

func (lv *LazyValue) Write(writer func(v core.Value, err error))

Write safely mutates an underlying value. Loads a value if it's not ready. Thread safe.

Jump to

Keyboard shortcuts

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