mirror

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MirrorInfo

type MirrorInfo struct {
	NodeID          string
	NodeName        string
	ParentID        string           // parent of this node
	ParentName      string           // parent's name
	OriginalID      string           // set on mirror copies (points to the original)
	MirrorLocations []MirrorLocation // locations where this is mirrored (with parent info)
	Item            *workflowy.Item  // reference to the original item
}

MirrorInfo represents mirror metadata for a node

func CollectMirrorInfos

func CollectMirrorInfos(items []*workflowy.Item) []*MirrorInfo

CollectMirrorInfos walks a tree and collects nodes with mirrorRootIds (originals that have mirrors) It also resolves parent information for each mirror location

func RankByMirrorCount

func RankByMirrorCount(infos []*MirrorInfo, topN int) []*MirrorInfo

RankByMirrorCount sorts mirror infos by count descending and returns top N If topN is 0, returns all

func (*MirrorInfo) MirrorCount

func (m *MirrorInfo) MirrorCount() int

MirrorCount returns the number of locations where this node is mirrored

type MirrorLocation

type MirrorLocation struct {
	ID         string
	ParentID   string
	ParentName string
}

MirrorLocation represents a location where a node is mirrored

Jump to

Keyboard shortcuts

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