utils

package
v0.0.0-...-74ad3e8 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 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 GetTextNode

func GetTextNode(node *html.Node) *html.Node

func GetUser

func GetUser(user def.UserData, project 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, project string) *datastore.Client

func PushUser

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

func QueryHtml

func QueryHtml(query string) *html.Node

func RegisterUser

func RegisterUser(user def.UserData, project 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