utils

package
Version: v0.0.0-...-4995d05 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterByNodeType

func FilterByNodeType(node *html.Node, nodeType html.NodeType) []*html.Node

func FilterChildren

func FilterChildren(node *html.Node, pred NodePredicate) []*html.Node

func FilterNodeList

func FilterNodeList(nodes []*html.Node, pred NodePredicate) []*html.Node

func FilterTree

func FilterTree(node *html.Node, pred NodePredicate) []*html.Node

func FindByClass

func FindByClass(node *html.Node, tag string) (*html.Node, error)

func FindNode

func FindNode(node *html.Node, pred NodePredicate) *html.Node

func GetHtml

func GetHtml(url string) *html.Node

func GetUser

func GetUser(user def.UserData, proj string) def.UserData

func MapNodeListToString

func MapNodeListToString(nodes []*html.Node, tran NodeTransform) []string

func MapTreeToString

func MapTreeToString(node *html.Node, tran NodeTransform) []string

func OpenClient

func OpenClient(ctx *context.Context, proj string) *datastore.Client

func PushUser

func PushUser(user def.UserData, proj string) bool

func QueryHtml

func QueryHtml(query string) *html.Node

func RegisterUser

func RegisterUser(user def.UserData, proj string) def.UserData

func SerializeUserConfig

func SerializeUserConfig(config UserConfig) string

Types

type NodePredicate

type NodePredicate func(*html.Node) bool

type NodeTransform

type NodeTransform func(*html.Node) string

type UserConfig

type UserConfig struct {
	Version       string `datastore:""`
	Timezone      string `datastore:""`
	Subscriptions string `datastore:""`
}

func DeserializeUserConfig

func DeserializeUserConfig(config string) UserConfig

Jump to

Keyboard shortcuts

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