util

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package util has reflection helpers

Package util has to assist with some time windowing

Index

Constants

View Source
const (
	// TimeWindowSpan indicates the delineation between start -> end (start:end)
	TimeWindowSpan = ":"
)

Variables

This section is empty.

Functions

func ListFields

func ListFields(p any) []string

ListFields will get the values of strings on an "all string" struct

func ReadDirFile

func ReadDirFile(dir, file string, e interface{ ReadFile(string) ([]byte, error) }) (string, error)

ReadDirFile will read a dir+file

func TextPositionFields

func TextPositionFields() string

TextPositionFields is the displayable set of templated fields

func TextWrap

func TextWrap(indent uint, in string) string

TextWrap performs simple block text word wrapping

Types

type Position

type Position struct {
	Start int
	End   int
}

Position is the start/end of a word in a greater set

type TimeWindow

type TimeWindow struct {
	Start int
	End   int
}

TimeWindow for handling terminal colors based on timing

func ParseTimeWindow

func ParseTimeWindow(windows ...string) ([]TimeWindow, error)

ParseTimeWindow will handle parsing a window of colors for TOTP operations

type Word

type Word struct {
	Text     string
	Position Position
}

Word is the text and position in a greater position

Jump to

Keyboard shortcuts

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