frame

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frame

type Frame struct {
	// contains filtered or unexported fields
}

A Frame is a collection of siblings in a trie, sorted alphabetically by name.

func New

func New(ctx context.Context, n noder.Noder) (*Frame, error)

New returns a frame with the children of the provided node.

func (*Frame) Drop

func (f *Frame) Drop()

Drop extracts the noder with the alphabetically smaller name in the frame or does nothing if the frame was empty.

func (*Frame) First

func (f *Frame) First() (noder.Noder, bool)

First returns, but dont extract, the noder with the alphabetically smaller name in the frame and true if the frame was not empty. Otherwise it returns nil and false.

func (*Frame) Len

func (f *Frame) Len() int

Len returns the number of noders in the frame.

func (*Frame) String

func (f *Frame) String() string

String returns the quoted names of the noders in the frame sorted in alphabetical order by name, surrounded by square brackets and separated by comas.

Examples:

[]
["a", "b"]

Jump to

Keyboard shortcuts

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