genres

package
v0.0.0-...-3525705 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown = Genre(iota)
	Blob
	Type
	Tag
	Zettel
	Config
	InventoryList
	Repo
)

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

Variables

View Source
var ErrNoAbbreviation = newPkgError("no abbreviation")

Functions

func All

func All() (out collections_slice.Slice[Genre])

TODO convert to seq

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 ErrWrongGenre

type ErrWrongGenre struct {
	Expected, Actual Genre
}

func (ErrWrongGenre) Error

func (err ErrWrongGenre) Error() string

func (ErrWrongGenre) GetErrorType

func (err ErrWrongGenre) GetErrorType() pkgErrDisamb

func (ErrWrongGenre) Is

func (err ErrWrongGenre) Is(target error) (ok bool)

type Genre

type Genre byte

func FromReader

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

func Make

func Make(genre interfaces.Genre) Genre

func MakeOrUnknown

func MakeOrUnknown(value string) (genre Genre)

func Must

func Must(genre interfaces.GenreGetter) Genre

func (Genre) AppendBinary

func (genre Genre) AppendBinary(b []byte) ([]byte, error)

func (Genre) AssertGenre

func (genre Genre) AssertGenre(other interfaces.GenreGetter) (err pkgError)

func (Genre) Byte

func (genre Genre) Byte() byte

func (Genre) Equals

func (genre Genre) Equals(b Genre) bool

func (Genre) GetGenre

func (genre Genre) GetGenre() interfaces.Genre

func (Genre) GetGenreBitInt

func (genre Genre) GetGenreBitInt() byte

func (Genre) IsConfig

func (genre Genre) IsConfig() bool

func (Genre) IsNone

func (genre Genre) IsNone() bool

func (Genre) IsTag

func (genre Genre) IsTag() bool

func (Genre) IsType

func (genre Genre) IsType() bool

func (Genre) IsZettel

func (genre Genre) IsZettel() bool

func (Genre) MarshalBinary

func (genre Genre) MarshalBinary() (b []byte, err error)

func (Genre) ReadByte

func (genre Genre) ReadByte() (byte, error)

func (*Genre) ReadFrom

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

func (*Genre) Reset

func (genre *Genre) Reset()

func (*Genre) Set

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

func (Genre) String

func (genre Genre) String() string

func (*Genre) UnmarshalBinary

func (genre *Genre) UnmarshalBinary(b []byte) (err error)

func (*Genre) WriteTo

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

Source Files

  • errors.go
  • from_reader.go
  • main.go

Jump to

Keyboard shortcuts

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