tag

package
v0.0.0-...-69547b0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package tag provides helper functions to work with the Tag member of the Node struct. To tag nodes during an operation, create a new context (e.g. SeenContext) and tag all nodes using that context. This ensures that any stale tags from an earlier context do not intefere with the new tags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(n *node.Node)

Clean resets tags on the Node graph rooted at n. TODO(callpraths): Use a smart Tagger to clean this up without walking nodes multiple times.

Types

type SeenContext

type SeenContext uuid.UUID

SeenContext is a tagging context used to mark nodes as having been visited during the current operation.

func NewSeenContext

func NewSeenContext() SeenContext

NewSeenContext returns an initialized SeenContext.

func (SeenContext) IsSeen

func (c SeenContext) IsSeen(n *node.Node) bool

IsSeen returns whether the given node was marked visited using the current context.

func (SeenContext) MarkSeen

func (c SeenContext) MarkSeen(n *node.Node)

MarkSeen marks the given node as having been visited in the current context.

Jump to

Keyboard shortcuts

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