summaryrefslogtreecommitdiff
path: root/internal/entry/entry.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-10-27 22:00:31 +0200
committerPaul Buetow <paul@buetow.org>2024-10-27 22:00:31 +0200
commitdb4b435716f150ce0e92f4e5d6e2b01e67d07086 (patch)
tree662d935708f14623cfe1d75a52d327741af55906 /internal/entry/entry.go
parent9827378121f1fc800171e84e4a9660615cb1f1db (diff)
initial refactor
Diffstat (limited to 'internal/entry/entry.go')
-rw-r--r--internal/entry/entry.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/entry/entry.go b/internal/entry/entry.go
index 1c5dbad..0fe203e 100644
--- a/internal/entry/entry.go
+++ b/internal/entry/entry.go
@@ -23,7 +23,7 @@ const (
)
var (
- validTags = []string{"ask", "prio", "now"}
+ validTags = []string{"ask", "prio", "now"} // TODO: Document all tags
ErrSizeLimitExceeded = errors.New("message size limit exceeded")
)
@@ -162,6 +162,10 @@ func (e Entry) Edit() error {
return nil
}
+func (e Entry) Remove() error {
+ return os.Remove(e.Path)
+}
+
func extractURLs(input string) []string {
urlPattern := `(http://|https://|ftp://)[^\s]+`
re := regexp.MustCompile(urlPattern)