store

package
v0.0.0-...-42ccff3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 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 Database

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

func NewDatabase

func NewDatabase() (*Database, error)

NewDatabase makes persistent sqlite based store

func (*Database) GetPosts

func (s *Database) GetPosts(page int, pageSize int, partitionKey string) (result *PaginationPostsResult, err error)

func (*Database) Migrate

func (s *Database) Migrate() error

func (*Database) SavePostsBulk

func (s *Database) SavePostsBulk(postsToSave []*PostV1) ([]*PostV1, error)

type PaginationPostsResult

type PaginationPostsResult struct {
	Posts        []*PostV1
	PartitionKey string
	Page         int
	PageSize     int
	Size         int64
}

type PostV1

type PostV1 struct {
	ID           string `gorm:"primaryKey"`
	PartitionKey string `gorm:"not null"`

	Title     string `gorm:"type:varchar(500);not null"`
	Text      string `gorm:"type:varchar(4000);not null"`
	SourceURL string `gorm:"not null"`

	CreatedAt time.Time
}

Jump to

Keyboard shortcuts

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