entry

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSizeLimitExceeded = errors.New("message size limit exceeded")
)
View Source
var Zero = Entry{}
View Source
var Zeroes = []Entry{}

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Path  string
	Time  time.Time
	State State
	Tags  map[string]struct{}
}

func New

func New(filePath string) (Entry, error)

filePath format: /foo/foobarbaz.something.here.txt.STAMP.{posted,queued} or for inboxed: /foo.txt or inboxed with tags: /foo.prio.ask.txt

func (Entry) After added in v1.0.0

func (en Entry) After(other Entry) (bool, error)

func (*Entry) Content

func (en *Entry) Content() (string, []string, error)

func (Entry) ContentWithLimit

func (en Entry) ContentWithLimit(sizeLimit int) (string, []string, error)

Returns the content and also checks for the size limit

func (Entry) Edit

func (en Entry) Edit() error

func (Entry) FileAction added in v1.0.0

func (en Entry) FileAction(question string) error

func (Entry) HasHashtags added in v1.0.0

func (en Entry) HasHashtags() (bool, error)

func (Entry) HasTag added in v1.0.0

func (en Entry) HasTag(tag string) bool

func (*Entry) MarkPosted

func (en *Entry) MarkPosted() error

func (*Entry) Name added in v1.0.0

func (en *Entry) Name() string

Returns the Name, e.g. foo.bar.baz from /path/foo.bar.baz.TIMESTAMP.posted

func (Entry) Remove added in v1.0.0

func (en Entry) Remove() error

func (Entry) String

func (en Entry) String() string

func (Entry) Timestamp added in v1.0.0

func (en Entry) Timestamp() (time.Time, error)

type State

type State int
const (
	Unknown State = iota
	Inboxed
	Queued
	Posted
)

func (State) String

func (s State) String() string

Jump to

Keyboard shortcuts

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