utils

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LevenshteinDistance added in v0.2.1

func LevenshteinDistance(a, b []rune) int

func ParseDateTime

func ParseDateTime(s string) (_time.Time, error)

func ParseDuration

func ParseDuration(s string) (_time.Duration, error)

Only supports minutes, hours, and days

func Pluralize

func Pluralize(count int64, singular string) string

func Relative

func Relative(seconds int64) string

func Score added in v0.2.1

func Score(q, b [][]rune) int

func Tokenize added in v0.2.1

func Tokenize(s string, tokens [][]rune) [][]rune

Types

type InternalError

type InternalError struct {
	Message string
}

func NewInternalError

func NewInternalError(message string) *InternalError

func (*InternalError) Error

func (e *InternalError) Error() string

type OPML added in v0.2.0

type OPML struct {
	XMLName xml.Name `xml:"opml"`
	Version string   `xml:"version,attr"`
	Head    OPMLHead `xml:"head"`
	Body    OPMLBody `xml:"body"`
}

func ParseOPMLBytes added in v0.4.1

func ParseOPMLBytes(data []byte) (*OPML, error)

func ParseOPMLFile added in v0.3.0

func ParseOPMLFile(path string) (*OPML, error)

type OPMLBody added in v0.3.0

type OPMLBody struct {
	Text      string         `xml:"text,attr,omitempty"`
	Outltines []*OPMLOutline `xml:"outline"`
}

type OPMLHead added in v0.3.0

type OPMLHead struct {
	Title       string `xml:"title,omitempty"`
	DateCreated string `xml:"dateCreated,omitempty"`
}

type OPMLOutline added in v0.3.0

type OPMLOutline struct {
	Text        string         `xml:"text,attr,omitempty"`
	Description string         `xml:"description,attr,omitempty"`
	XMLURL      string         `xml:"xmlUrl,attr,omitempty"`
	Outlines    []*OPMLOutline `xml:"outline"`
}

type Time

type Time interface {
	Now() _time.Time
}

func NewTime

func NewTime() Time

Jump to

Keyboard shortcuts

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