separator

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: GPL-3.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

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

Content represents a pair of left and right separators for content.

func NewContent

func NewContent(left, right Separator) *Content

NewContent creates a new Content separator with the specified left and right separators.

Parameters:

left  - the left separator
right - the right separator

Returns:

A pointer to a Content struct.

func NewRepeatedContent

func NewRepeatedContent(separator Separator) *Content

NewRepeatedContent creates a new Content separator with the same separator for both left and right.

Parameters:

separator - the separator to use for both left and right

Returns:

A pointer to a Content struct.

func (Content) Left

func (c Content) Left() Separator

Left returns the left separator of the Content.

func (Content) LeftStr added in v0.1.7

func (c Content) LeftStr() string

LeftStr returns the left separator as a string.

func (Content) Right

func (c Content) Right() Separator

Right returns the right separator of the Content.

func (Content) RightStr added in v0.1.7

func (c Content) RightStr() string

RightStr returns the right separator as a string.

type Multiline

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

Multiline represents separators for formatting multiline content.

func NewMultiline

func NewMultiline(
	singleLine, line Separator,
	tabSize int,
) *Multiline

NewMultiline creates a new Multiline separator with the specified single line, multiple line separators, and tab size.

Parameters:

singleLine - the separator for a single element
line       - the separator for multiple elements
tabSize    - the number of tabs to use for indentation

Returns:

A pointer to a Multiline struct.

func (Multiline) MultipleElements added in v0.1.12

func (m Multiline) MultipleElements() Separator

MultipleElements returns the separator for multiple elements.

func (Multiline) MultipleElementsStr added in v0.1.12

func (m Multiline) MultipleElementsStr() string

MultipleElementsStr returns the multiple elements separator as a string.

func (Multiline) SingleElement added in v0.1.12

func (m Multiline) SingleElement() Separator

SingleElement returns the separator for a single element.

func (Multiline) SingleElementStr added in v0.1.12

func (m Multiline) SingleElementStr() string

SingleElementStr returns the single element separator as a string.

func (Multiline) TabSize

func (m Multiline) TabSize() int

TabSize returns the tab size used for indentation.

func (Multiline) TabStr added in v0.1.7

func (m Multiline) TabStr() string

TabStr returns the tab separator as a string, repeated tabSize times.

type Separator

type Separator string

Separator represents a string separator.

const (
	Space     Separator = " "
	Comma     Separator = ","
	NewLine   Separator = "\n"
	Tab       Separator = "\t"
	Dots      Separator = ":"
	Slash     Separator = "/"
	Backslash Separator = "\\"
)

Separator constants for common separators.

Jump to

Keyboard shortcuts

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