models

package
v0.0.0-...-d9f8d9e Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(dataSourceName string)

InitDB creates the database and migrates it to the correct version.

func SaveURL

func SaveURL(ctx context.Context, link string, tweetID string) error

SaveURL does an upsert on a URL.

Types

type SavedURL

type SavedURL struct {
	Link       string
	TweetIDs   []string
	CreatedAt  time.Time
	ModifiedAt time.Time
}

SavedURL stores a single url seen in a tweet.

func AllSavedURLs

func AllSavedURLs(ctx context.Context) ([]*SavedURL, error)

AllSavedURLs returns all of the urls ever seen.

func SomeSavedURLs

func SomeSavedURLs(ctx context.Context, limit int) ([]*SavedURL, error)

SomeSavedURLs returns a subset of most recently seen urls.

Jump to

Keyboard shortcuts

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