Update to use commons package

- Rename module from publisher to publish
- Change all shared.* references to commons.*
- Use commons.Item, commons.Feed, etc from shared library

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-02-02 15:40:39 -05:00
parent f1e68d42fc
commit e55cff3daa
5 changed files with 52 additions and 52 deletions
+12 -12
View File
@@ -8,11 +8,11 @@ import (
)
// scanItems scans rows into Item structs
func scanItems(rows pgx.Rows) ([]*shared.Item, error) {
var items []*shared.Item
func scanItems(rows pgx.Rows) ([]*commons.Item, error) {
var items []*commons.Item
for rows.Next() {
item := &shared.Item{}
item := &commons.Item{}
var guid, title, link, description, content, author *string
var pubDate, updatedAt, publishedAt *interface{}
var publishedUri *string
@@ -32,13 +32,13 @@ func scanItems(rows pgx.Rows) ([]*shared.Item, error) {
continue
}
item.GUID = shared.StringValue(guid)
item.Title = shared.StringValue(title)
item.Link = shared.StringValue(link)
item.Description = shared.StringValue(description)
item.Content = shared.StringValue(content)
item.Author = shared.StringValue(author)
item.PublishedUri = shared.StringValue(publishedUri)
item.GUID = commons.StringValue(guid)
item.Title = commons.StringValue(title)
item.Link = commons.StringValue(link)
item.Description = commons.StringValue(description)
item.Content = commons.StringValue(content)
item.Author = commons.StringValue(author)
item.PublishedUri = commons.StringValue(publishedUri)
if pubDate != nil {
if t, ok := (*pubDate).(interface{ Time() interface{} }); ok {
@@ -49,9 +49,9 @@ func scanItems(rows pgx.Rows) ([]*shared.Item, error) {
}
if enclosureUrl != nil && *enclosureUrl != "" {
item.Enclosure = &shared.Enclosure{
item.Enclosure = &commons.Enclosure{
URL: *enclosureUrl,
Type: shared.StringValue(enclosureType),
Type: commons.StringValue(enclosureType),
}
if enclosureLength != nil {
item.Enclosure.Length = *enclosureLength