diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-13 10:01:59 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-13 10:01:59 +0200 |
| commit | 44a426c883a2c448d40a19903c822d03e5cf70af (patch) | |
| tree | dbb1fe11db1993c2cac7daf1c9930e37f44b38d1 /internal/entry/entry.go | |
| parent | cfddc5696f4956081630e3d394ef3d8c652af02e (diff) | |
chore: complete code quality audit fixesv1.2.6
- Fixed failing test in config_test.go (hardcoded date)
- Addressed unchecked error returns from Close() operations
- Refactored large functions to follow SRP (run.go and main.go)
- Added documentation to exported identifiers
- Fixed linting errors (error message capitalization, errcheck)
- Bumped version to v1.2.6
Diffstat (limited to 'internal/entry/entry.go')
| -rw-r--r-- | internal/entry/entry.go | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/internal/entry/entry.go b/internal/entry/entry.go index 4454b01..2f6bd16 100644 --- a/internal/entry/entry.go +++ b/internal/entry/entry.go @@ -1,3 +1,5 @@ +// Package entry handles the representation and manipulation of social media post entries. +// It defines the Entry struct and provides methods for parsing, modifying, and posting entries. package entry import ( @@ -15,20 +17,27 @@ import ( "codeberg.org/snonux/gos/internal/timestamp" ) +// State represents the lifecycle state of an entry. type State int const ( + // Unknown represents the unknown state of an entry. Unknown State = iota - Inboxed - Queued - Posted + // Inboxed represents the inboxed state of an entry. + Inboxed State = iota + // Queued represents the queued state of an entry. + Queued State = iota + // Posted represents the posted state of an entry. + Posted State = iota ) -var ( - validTags = []string{"ask", "prio", "now"} - ErrSizeLimitExceeded = errors.New("message size limit exceeded") -) +// validTags contains the list of valid tags that can be applied to entries. +var validTags = []string{"ask", "prio", "now"} + +// ErrSizeLimitExceeded is returned when an entry exceeds the size limit for a platform. +var ErrSizeLimitExceeded = errors.New("message size limit exceeded") +// String returns the string representation of the State. func (s State) String() string { switch s { case Unknown: |
