Documentation
¶
Index ¶
- Constants
- func NewFeed() *feedImplementation
- func NewFeedFromExistingData(data map[string]string) *feedImplementation
- func NewLink() *linkImplementation
- func NewLinkFromExistingData(data map[string]string) *linkImplementation
- type FeedInterface
- type FeedQueryInterface
- type LinkInterface
- type LinkQueryInterface
- type NewStoreOptions
- type StoreInterface
Constants ¶
View Source
const COLUMN_AUTHOR = "author"
View Source
const COLUMN_CHECKED_AT = "checked_at"
View Source
const COLUMN_CONTENT = "content"
View Source
const COLUMN_CREATED_AT = "created_at"
View Source
const COLUMN_DEDUP_HASH = "dedup_hash"
View Source
const COLUMN_DESCRIPTION = "description"
View Source
const COLUMN_FEED_ID = "feed_id"
View Source
const COLUMN_FETCH_INTERVAL = "fetch_interval"
View Source
const COLUMN_ID = "id"
View Source
const COLUMN_LANGUAGE = "language"
View Source
const COLUMN_LAST_FETCHED_AT = "last_fetched_at"
View Source
const COLUMN_MEMO = "memo"
View Source
const COLUMN_METAS = "metas"
View Source
const COLUMN_NAME = "name"
View Source
const COLUMN_PRIORITY = "priority"
View Source
const COLUMN_PUBLISHED_AT = "published_at"
View Source
const COLUMN_REPORT = "report"
View Source
const COLUMN_REPORTED_AT = "reported_at"
View Source
const COLUMN_SOFT_DELETED_AT = "soft_deleted_at"
View Source
const COLUMN_STATUS = "status"
View Source
const COLUMN_TITLE = "title"
View Source
const COLUMN_UPDATED_AT = "updated_at"
View Source
const COLUMN_URL = "url"
View Source
const COLUMN_VIEWS = "views"
View Source
const COLUMN_VOTES_DOWN = "votes_down"
View Source
const COLUMN_VOTES_UP = "votes_up"
View Source
const FEED_STATUS_ACTIVE = "active"
View Source
const FEED_STATUS_INACTIVE = "inactive"
View Source
const LINK_STATUS_ACTIVE = "active"
View Source
const LINK_STATUS_INACTIVE = "inactive"
Variables ¶
This section is empty.
Functions ¶
func NewFeedFromExistingData ¶
func NewLinkFromExistingData ¶
Types ¶
type FeedInterface ¶
type FeedInterface interface {
Data() map[string]string
MarkAsNotDirty(...string)
// GetCreatedAt returns the created at timestamp as a string
GetCreatedAt() string
// GetCreatedAtCarbon returns the created at timestamp as a carbon instance
GetCreatedAtCarbon() *carbon.Carbon
// SetCreatedAt sets the created at timestamp
SetCreatedAt(createdAt string) FeedInterface
// GetDescription returns the description
GetDescription() string
// SetDescription sets the description
SetDescription(description string) FeedInterface
// GetFetchInterval returns the fetch interval
GetFetchInterval() string
// SetFetchInterval sets the fetch interval
SetFetchInterval(fetchInterval string) FeedInterface
// GetID returns the ID
GetID() string
// SetID sets the ID
SetID(id string) FeedInterface
// GetLanguage returns the language
GetLanguage() string
// SetLanguage sets the language
SetLanguage(language string) FeedInterface
// GetLastFetchedAt returns the last fetched at timestamp as a string
GetLastFetchedAt() string
// GetLastFetchedAtCarbon returns the last fetched at timestamp as a carbon instance
GetLastFetchedAtCarbon() *carbon.Carbon
// SetLastFetchedAt sets the last fetched at timestamp
SetLastFetchedAt(lastFetchedAt time.Time) FeedInterface
// SetLastFetchedAtString sets the last fetched at timestamp from a string
SetLastFetchedAtString(lastFetchedAt string) FeedInterface
// GetMemo returns the memo
GetMemo() string
// SetMemo sets the memo
SetMemo(memo string) FeedInterface
// GetMeta returns a specific meta value by key
GetMeta(key string) (string, error)
// SetMeta sets a specific meta value by key
SetMeta(key string, value string) error
// DeleteMeta removes a specific meta value by key
DeleteMeta(key string) error
// GetMetas returns all meta values as a map
GetMetas() (map[string]string, error)
// SetMetas sets all meta values from a map
SetMetas(metas map[string]string) error
// GetName returns the name
GetName() string
// SetName sets the name
SetName(name string) FeedInterface
// GetSoftDeletedAt returns the soft deleted at timestamp as a string
GetSoftDeletedAt() string
// GetSoftDeletedAtCarbon returns the soft deleted at timestamp as a carbon instance
GetSoftDeletedAtCarbon() *carbon.Carbon
// SetSoftDeletedAt sets the soft deleted at timestamp
SetSoftDeletedAt(softDeletedAt string) FeedInterface
// GetStatus returns the status
GetStatus() string
// SetStatus sets the status
SetStatus(status string) FeedInterface
// GetUpdatedAt returns the updated at timestamp as a string
GetUpdatedAt() string
// GetUpdatedAtCarbon returns the updated at timestamp as a carbon instance
GetUpdatedAtCarbon() *carbon.Carbon
// SetUpdatedAt sets the updated at timestamp
SetUpdatedAt(updatedAt string) FeedInterface
// GetURL returns the URL
GetURL() string
// SetURL sets the URL
SetURL(url string) FeedInterface
}
type FeedQueryInterface ¶
type FeedQueryInterface interface {
// Validation method
Validate() error
// Count related methods
IsCountOnlySet() bool
GetCountOnly() bool
SetCountOnly(countOnly bool) FeedQueryInterface
// Soft delete related query methods
IsWithSoftDeletedSet() bool
GetWithSoftDeleted() bool
SetWithSoftDeleted(withSoftDeleted bool) FeedQueryInterface
IsOnlySoftDeletedSet() bool
GetOnlySoftDeleted() bool
SetOnlySoftDeleted(onlySoftDeleted bool) FeedQueryInterface
IsCreatedAtGteSet() bool
GetCreatedAtGte() string
SetCreatedAtGte(createdAt string) FeedQueryInterface
IsCreatedAtLteSet() bool
GetCreatedAtLte() string
SetCreatedAtLte(createdAt string) FeedQueryInterface
IsIDSet() bool
GetID() string
SetID(id string) FeedQueryInterface
IsIDInSet() bool
GetIDIn() []string
SetIDIn(ids []string) FeedQueryInterface
IsLanguageSet() bool
GetLanguage() string
SetLanguage(language string) FeedQueryInterface
IsLastFetchedAtLteSet() bool
GetLastFetchedAtLte() string
SetLastFetchedAtLte(lastFetchedAtLte string) FeedQueryInterface
IsLastFetchedAtGteSet() bool
GetLastFetchedAtGte() string
SetLastFetchedAtGte(lastFetchedAtGte string) FeedQueryInterface
IsLimitSet() bool
GetLimit() int
SetLimit(limit int) FeedQueryInterface
IsOffsetSet() bool
GetOffset() int
SetOffset(offset int) FeedQueryInterface
IsOrderBySet() bool
GetOrderBy() string
SetOrderBy(orderBy string) FeedQueryInterface
IsOrderDirectionSet() bool
GetOrderDirection() string
SetOrderDirection(orderDirection string) FeedQueryInterface
IsStatusSet() bool
GetStatus() string
SetStatus(status string) FeedQueryInterface
IsStatusInSet() bool
GetStatusIn() []string
SetStatusIn(statuses []string) FeedQueryInterface
IsUpdatedAtGteSet() bool
GetUpdatedAtGte() string
SetUpdatedAtGte(updatedAt string) FeedQueryInterface
IsUpdatedAtLteSet() bool
GetUpdatedAtLte() string
SetUpdatedAtLte(updatedAt string) FeedQueryInterface
// Owner ID (legacy, kept for compatibility)
IsOwnerIDSet() bool
GetOwnerID() string
SetOwnerID(ownerID string) FeedQueryInterface
}
FeedQueryInterface defines the interface for querying feeds
type LinkInterface ¶
type LinkInterface interface {
Data() map[string]string
MarkAsNotDirty(...string)
// Creation and update timestamps
GetCreatedAt() string
GetCreatedAtCarbon() *carbon.Carbon
SetCreatedAt(createdAt string) LinkInterface
GetDescription() string
SetDescription(description string) LinkInterface
GetContent() string
SetContent(content string) LinkInterface
GetAuthor() string
SetAuthor(author string) LinkInterface
GetPriority() bool
SetPriority(priority bool) LinkInterface
GetFeedID() string
SetFeedID(feedID string) LinkInterface
GetID() string
SetID(id string) LinkInterface
GetLanguage() string
SetLanguage(language string) LinkInterface
GetMeta(key string) (string, error)
SetMeta(key string, value string) error
DeleteMeta(key string) error
GetMetas() (map[string]string, error)
SetMetas(metas map[string]string) error
GetStatus() string
SetStatus(status string) LinkInterface
GetTitle() string
SetTitle(title string) LinkInterface
GetPublishedAt() string
GetPublishedAtCarbon() *carbon.Carbon
SetPublishedAt(publishedAt time.Time) LinkInterface
SetPublishedAtString(publishedAt string) LinkInterface
GetDedupHash() string
SetDedupHash(dedupHash string) LinkInterface
GetSoftDeletedAt() string
GetSoftDeletedAtCarbon() *carbon.Carbon
SetSoftDeletedAt(softDeletedAt string) LinkInterface
GetUpdatedAt() string
GetUpdatedAtCarbon() *carbon.Carbon
SetUpdatedAt(updatedAt string) LinkInterface
GetURL() string
SetURL(url string) LinkInterface
GetViews() string
SetViews(views string) LinkInterface
GetVotesUp() string
SetVotesUp(votesUp string) LinkInterface
GetVotesDown() string
SetVotesDown(votesDown string) LinkInterface
GetReport() string
SetReport(report string) LinkInterface
GetReportedAt() string
GetReportedAtCarbon() *carbon.Carbon
SetReportedAt(reportedAt time.Time) LinkInterface
SetReportedAtString(reportedAt string) LinkInterface
GetCheckedAt() string
GetCheckedAtCarbon() *carbon.Carbon
SetCheckedAt(timeChecked time.Time) LinkInterface
SetCheckedAtString(timeChecked string) LinkInterface
}
type LinkQueryInterface ¶
type LinkQueryInterface interface {
// Validation method
Validate() error
// Count related methods
IsCountOnlySet() bool
GetCountOnly() bool
SetCountOnly(countOnly bool) LinkQueryInterface
// Soft delete related query methods
IsWithSoftDeletedSet() bool
GetWithSoftDeleted() bool
SetWithSoftDeleted(withSoftDeleted bool) LinkQueryInterface
IsOnlySoftDeletedSet() bool
GetOnlySoftDeleted() bool
SetOnlySoftDeleted(onlySoftDeleted bool) LinkQueryInterface
IsCreatedAtGteSet() bool
GetCreatedAtGte() string
SetCreatedAtGte(createdAt string) LinkQueryInterface
IsCreatedAtLteSet() bool
GetCreatedAtLte() string
SetCreatedAtLte(createdAt string) LinkQueryInterface
IsFeedIDSet() bool
GetFeedID() string
SetFeedID(feedID string) LinkQueryInterface
IsIDSet() bool
GetID() string
SetID(id string) LinkQueryInterface
IsIDInSet() bool
GetIDIn() []string
SetIDIn(ids []string) LinkQueryInterface
IsLanguageSet() bool
GetLanguage() string
SetLanguage(language string) LinkQueryInterface
IsLimitSet() bool
GetLimit() int
SetLimit(limit int) LinkQueryInterface
IsOffsetSet() bool
GetOffset() int
SetOffset(offset int) LinkQueryInterface
IsOrderBySet() bool
GetOrderBy() string
SetOrderBy(orderBy string) LinkQueryInterface
IsOrderDirectionSet() bool
GetOrderDirection() string
SetOrderDirection(orderDirection string) LinkQueryInterface
IsStatusSet() bool
GetStatus() string
SetStatus(status string) LinkQueryInterface
IsStatusInSet() bool
GetStatusIn() []string
SetStatusIn(statuses []string) LinkQueryInterface
IsURLSet() bool
GetURL() string
SetURL(url string) LinkQueryInterface
IsUpdatedAtGteSet() bool
GetUpdatedAtGte() string
SetUpdatedAtGte(updatedAt string) LinkQueryInterface
IsUpdatedAtLteSet() bool
GetUpdatedAtLte() string
SetUpdatedAtLte(updatedAt string) LinkQueryInterface
// PublishedAt (publication datetime) filters
IsPublishedAtGteSet() bool
GetPublishedAtGte() string
SetPublishedAtGte(publishedAt string) LinkQueryInterface
IsPublishedAtLteSet() bool
GetPublishedAtLte() string
SetPublishedAtLte(publishedAt string) LinkQueryInterface
// Dedup hash filter
IsDedupHashSet() bool
GetDedupHash() string
SetDedupHash(dedupHash string) LinkQueryInterface
// Priority filter
IsPrioritySet() bool
GetPriority() string
SetPriority(priority string) LinkQueryInterface
// Owner ID (legacy, kept for compatibility)
IsOwnerIDSet() bool
GetOwnerID() string
SetOwnerID(ownerID string) LinkQueryInterface
}
LinkQueryInterface defines the interface for querying links
type NewStoreOptions ¶
type NewStoreOptions struct {
FeedTableName string
LinkTableName string
DB *sql.DB
AutomigrateEnabled bool
DebugEnabled bool
}
NewStoreOptions define the options for creating a new feed store
type StoreInterface ¶
type StoreInterface interface {
// MigrateDown drops the feed and link tables
MigrateDown(ctx context.Context, tx ...*sql.Tx) error
// MigrateUp creates the feed and link tables
MigrateUp(ctx context.Context, tx ...*sql.Tx) error
EnableDebug(debug bool)
GetDB() *sql.DB
GetFeedTableName() string
GetLinkTableName() string
FeedCount(ctx context.Context, query FeedQueryInterface) (int64, error)
FeedCreate(ctx context.Context, feed FeedInterface) error
FeedDelete(ctx context.Context, feed FeedInterface) error
FeedDeleteByID(ctx context.Context, id string) error
FeedFindByID(ctx context.Context, id string) (FeedInterface, error)
FeedList(ctx context.Context, query FeedQueryInterface) ([]FeedInterface, error)
FeedSoftDelete(ctx context.Context, feed FeedInterface) error
FeedSoftDeleteByID(ctx context.Context, id string) error
FeedUpdate(ctx context.Context, feed FeedInterface) error
LinkCount(ctx context.Context, query LinkQueryInterface) (int64, error)
LinkCreate(ctx context.Context, link LinkInterface) error
LinkDelete(ctx context.Context, link LinkInterface) error
LinkDeleteByID(ctx context.Context, id string) error
LinkFindByID(ctx context.Context, id string) (LinkInterface, error)
LinkList(ctx context.Context, query LinkQueryInterface) ([]LinkInterface, error)
LinkSoftDelete(ctx context.Context, link LinkInterface) error
LinkSoftDeleteByID(ctx context.Context, id string) error
LinkUpdate(ctx context.Context, link LinkInterface) error
}
func NewStore ¶
func NewStore(opts NewStoreOptions) (StoreInterface, error)
NewStore creates a new feed store
Click to show internal directories.
Click to hide internal directories.