common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

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)

* 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

* Indicates whether the value is ready. * @returns (Boolean) - Boolean value indicating whether the value is ready.

func (*LazyValue) Reset

func (lv *LazyValue) 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))

* 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