storage

package
v0.0.0-...-3273997 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	Created     time.Time `json:"created"`
	Published   time.Time `json:"published"`
	ResourceId  string    `json:"resource_id"`
	Link        string    `json:"link" gorm:"primaryKey"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Content     string    `json:"content"`
	Author      string    `json:"author"`
	Image       string    `json:"image"`
}

type ArticleRepository

type ArticleRepository struct {
	// contains filtered or unexported fields
}

func NewArticleRepository

func NewArticleRepository(db *db.DB) (*ArticleRepository, error)

func (*ArticleRepository) List

func (r *ArticleRepository) List(ctx context.Context, after time.Time) ([]*Article, error)

func (*ArticleRepository) Upsert

func (r *ArticleRepository) Upsert(ctx context.Context, article *Article) error

type Resource

type Resource struct {
	Active    bool      `json:"active"`
	Created   time.Time `json:"created"`
	Modified  time.Time `json:"modified"`
	Published time.Time `json:"published"`
	Title     string    `json:"title"`
	Url       string    `json:"url" gorm:"primaryKey"`
}

type ResourceRepository

type ResourceRepository struct {
	// contains filtered or unexported fields
}

func NewResourceRepository

func NewResourceRepository(db *db.DB) (*ResourceRepository, error)

func (*ResourceRepository) Activate

func (r *ResourceRepository) Activate(ctx context.Context, urls []string, active bool) error

func (*ResourceRepository) Delete

func (r *ResourceRepository) Delete(ctx context.Context, urls []string) error

func (*ResourceRepository) Get

func (r *ResourceRepository) Get(ctx context.Context, url string) (*Resource, error)

func (*ResourceRepository) List

func (r *ResourceRepository) List(ctx context.Context, active bool) ([]*Resource, error)

func (*ResourceRepository) Upsert

func (r *ResourceRepository) Upsert(ctx context.Context, repoInfo *Resource) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL