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_CHECKED_AT = "checked_at"
View Source
const COLUMN_CREATED_AT = "created_at"
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_LAST_FETCHED_AT = "last_fetched_at"
View Source
const COLUMN_MEMO = "memo"
View Source
const COLUMN_NAME = "name"
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_TIME = "time"
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
DataChanged() map[string]string
MarkAsNotDirty()
CreatedAt() string
CreatedAtCarbon() *carbon.Carbon
SetCreatedAt(createdAt string) FeedInterface
Description() string
SetDescription(description string) FeedInterface
FetchInterval() string
SetFetchInterval(fetchInterval string) FeedInterface
ID() string
SetID(id string) FeedInterface
LastFetchedAt() string
SetLastFetchedAt(lastFetchedAt string) FeedInterface
Memo() string
SetMemo(memo string) FeedInterface
Name() string
SetName(name string) FeedInterface
SoftDeletedAt() string
SoftDeletedAtCarbon() *carbon.Carbon
SetSoftDeletedAt(softDeletedAt string) FeedInterface
Status() string
SetStatus(status string) FeedInterface
UpdatedAt() string
UpdatedAtCarbon() *carbon.Carbon
SetUpdatedAt(updatedAt string) FeedInterface
URL() string
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
// Dataset conversion methods
ToSelectDataset(store StoreInterface) (selectDataset *goqu.SelectDataset, columns []any, err error)
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
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
SetStatusIn(statuses []string) FeedQueryInterface
IsUpdatedAtGteSet() bool
GetUpdatedAtGte() string
SetUpdatedAtGte(updatedAt string) FeedQueryInterface
IsUpdatedAtLteSet() bool
GetUpdatedAtLte() string
SetUpdatedAtLte(updatedAt string) FeedQueryInterface
}
FeedQueryInterface defines the interface for querying feeds
type LinkInterface ¶
type LinkInterface interface {
Data() map[string]string
DataChanged() map[string]string
MarkAsNotDirty()
CreatedAt() string
CreatedAtCarbon() *carbon.Carbon
SetCreatedAt(createdAt string) LinkInterface
Description() string
SetDescription(description string) LinkInterface
FeedID() string
SetFeedID(feedID string) LinkInterface
ID() string
SetID(id string) LinkInterface
Status() string
SetStatus(status string) LinkInterface
Title() string
SetTitle(title string) LinkInterface
Time() string
TimeCarbon() *carbon.Carbon
SetTime(time string) LinkInterface
SoftDeletedAt() string
SoftDeletedAtCarbon() *carbon.Carbon
SetSoftDeletedAt(softDeletedAt string) LinkInterface
UpdatedAt() string
UpdatedAtCarbon() *carbon.Carbon
SetUpdatedAt(updatedAt string) LinkInterface
URL() string
SetURL(url 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
// Dataset conversion methods
ToSelectDataset(store StoreInterface) (selectDataset *goqu.SelectDataset, columns []any, err error)
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
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
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
}
LinkQueryInterface defines the interface for querying links
type NewStoreOptions ¶
type NewStoreOptions struct {
FeedTableName string
LinkTableName string
DB *sql.DB
DbDriverName string
AutomigrateEnabled bool
DebugEnabled bool
}
NewStoreOptions define the options for creating a new block store
type StoreInterface ¶
type StoreInterface interface {
AutoMigrate() error
EnableDebug(debug bool)
GetDriverName() string
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 block store
Click to show internal directories.
Click to hide internal directories.