genres

package
v0.0.0-...-32d88a2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None = Genre(iota)
	Blob
	Type

	Tag

	Zettel
	Config

	InventoryList

	Repo

	MaxGenre = Repo
)

Do not change this order, various serialization formats rely on the underlying integer values.

Variables

View Source
var ErrNoAbbreviation = errors.New("no abbreviation")

Functions

func ConfirmTypeFromReader

func ConfirmTypeFromReader(t Genre, r *bufio.Reader) (err error)

func IsErrUnrecognizedGenre

func IsErrUnrecognizedGenre(err error) bool

func IsErrUnsupportedGenre

func IsErrUnsupportedGenre(err error) bool

func MakeErrUnrecognizedGenre

func MakeErrUnrecognizedGenre(v string) errUnrecognizedGenre

func MakeErrUnsupportedGenre

func MakeErrUnsupportedGenre(g interfaces.GenreGetter) error

Types

type ErrEmptyObjectId

type ErrEmptyObjectId struct{}

func (ErrEmptyObjectId) Error

func (e ErrEmptyObjectId) Error() string

func (ErrEmptyObjectId) Is

func (e ErrEmptyObjectId) Is(target error) (ok bool)

type ErrWrongType

type ErrWrongType struct {
	ExpectedType, ActualType Genre
}

func (ErrWrongType) Error

func (e ErrWrongType) Error() string

func (ErrWrongType) Is

func (e ErrWrongType) Is(target error) (ok bool)

type Genre

type Genre byte

func All

func All() (out []Genre)

TODO switch to quiter.Slice[Genre](All())

func FromReader

func FromReader(r *bufio.Reader) (t Genre, err error)

func Make

func Make(g interfaces.Genre) Genre

func MakeOrUnknown

func MakeOrUnknown(v string) (g Genre)

func Must

func TrueGenre

func TrueGenre() (out []Genre)

TODO switch to quiter.Slice[Genre](TrueGenre())

func (Genre) AssertGenre

func (a Genre) AssertGenre(b interfaces.GenreGetter) (err error)

func (Genre) Equals

func (a Genre) Equals(b Genre) bool

func (Genre) EqualsAny

func (a Genre) EqualsAny(b any) bool

func (Genre) EqualsGenre

func (a Genre) EqualsGenre(b interfaces.GenreGetter) bool

func (Genre) GetGenre

func (g Genre) GetGenre() interfaces.Genre

func (Genre) GetGenreBitInt

func (g Genre) GetGenreBitInt() byte

func (Genre) GetGenreString

func (g Genre) GetGenreString() string

func (Genre) GetGenreStringPlural

func (g Genre) GetGenreStringPlural(sv interfaces.StoreVersion) string

func (Genre) HasParents

func (g Genre) HasParents() bool

func (Genre) IsTrueGenre

func (g Genre) IsTrueGenre() bool

func (*Genre) ReadFrom

func (g *Genre) ReadFrom(r io.Reader) (n int64, err error)

func (*Genre) Reset

func (g *Genre) Reset()

func (*Genre) Set

func (g *Genre) Set(v string) (err error)

func (Genre) String

func (g Genre) String() string

func (*Genre) WriteTo

func (g *Genre) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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