redirectdefinitionutils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoCreateRedirectDefinitions

func AutoCreateRedirectDefinitions(
	l *zap.Logger,
	oldMap, newMap map[string]*content.RepoNode,
	dimension redirectstore.Dimension,
) ([]*redirectstore.RedirectDefinition, error)

AutoCreateRedirectDefinitions generates automatic redirects based on the difference between the old and new content tree. find new.ID to old.ID and check if the URI is different, if it is different, create a redirect

func ConsolidateRedirectDefinitions

func ConsolidateRedirectDefinitions(
	l *zap.Logger,
	new []*redirectstore.RedirectDefinition,
	current redirectstore.RedirectDefinitions,
	newNodeMap map[string]*content.RepoNode,
) ([]*redirectstore.RedirectDefinition, []redirectstore.EntityID)

Consolidate redirect definitions by: * Making list for update with new and updated definitions * Making list for deleting for definitions with empty target id * If target of one is source to another one, consolidate those into one definition to prevent multiple redirections

func CreateFlatRepoNodeMap added in v1.0.0

func CreateFlatRepoNodeMap(node *content.RepoNode, nodeMap map[string]*content.RepoNode) map[string]*content.RepoNode

CreateFlatRepoNodeMap recursively retrieves all nodes from the tree and returns them in a flat map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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