orm

package
v0.0.0-...-b8661fc Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient() *datastore.Client

func GetSong

func GetSong(ctx context.Context, id string) (song model.Song, err error)

func GetSongs

func GetSongs(ctx context.Context) (songs []model.Song, err error)

func GetUpdatedSongs

func GetUpdatedSongs(ctx context.Context, fromTime time.Time) (songs []model.Song, err error)

func SaveSong

func SaveSong(ctx context.Context, song *model.Song) error

func SaveSongs

func SaveSongs(ctx context.Context, songs []model.Song) error

Types

type Cache

type Cache map[string]map[string]*CacheItem

type CacheItem

type CacheItem struct {
	Item interface{}
}

type SssData

type SssData interface {
	SaveSong(song *model.Song) error
	SaveSongs(songs []*model.Song) error

	GetSongs() ([]model.Song, error)
	GetSong(id string) (model.Song, error)
	GetUpdatedSongs(fromTime time.Time) ([]model.Song, error)
}

SssData defines interface for data persistence on SSS

type Stats

type Stats struct {
	Count     int64     `datastore:"count"`
	TimeStamp time.Time `datastore:"timestamp"`
}

Jump to

Keyboard shortcuts

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