models

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DateFormat = tools.DateFormat

Variables

View Source
var ErrorMissingDate = errors.New("Missing date")
View Source
var ErrorMissingTitle = errors.New("Missing title")
View Source
var ErrorParsing = errors.New("Parsing Error")

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Title  string
	Date   time.Time
	Fields Metas
}

func (Entry) MarshalJSON

func (e Entry) MarshalJSON() ([]byte, error)

func (Entry) MarshalText

func (e Entry) MarshalText() ([]byte, error)

func (*Entry) UnmarshalJSON

func (e *Entry) UnmarshalJSON(in []byte) error

func (*Entry) UnmarshalText

func (m *Entry) UnmarshalText(in []byte) error

type Log

type Log struct {
	Name    string
	Entries []Entry
}

func (*Log) UnmarshalText

func (l *Log) UnmarshalText(in []byte) error

type Meta

type Meta struct {
	Key   string
	Value any
}

func (Meta) MarshalText

func (m Meta) MarshalText() ([]byte, error)

func (*Meta) UnmarshalText

func (m *Meta) UnmarshalText(in []byte) error

type Metas added in v0.0.3

type Metas []Meta

A slice of Meta

func (Metas) Append added in v0.0.3

func (ms Metas) Append(k string, v any) Metas

Returns a new Metas with a new Meta appended

func (*Metas) AppendTo added in v0.0.3

func (ms *Metas) AppendTo(k string, v any)

Appends a new Meta to this Metas

func (Metas) Map added in v0.0.3

func (ms Metas) Map() map[string]any

Returns a single map containing all the Meta. Is useful when encoding to JSON

func (Metas) MarshalJSON added in v0.0.3

func (ms Metas) MarshalJSON() ([]byte, error)

Implements json.Marshaler

func (*Metas) UnmarshalJSON added in v0.0.3

func (ms *Metas) UnmarshalJSON(in []byte) error

Implements json.Unmarshaler

Jump to

Keyboard shortcuts

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