shorten

package
v0.0.0-...-82364ab Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	ID        int64
	URL       string
	Hash      string
	CreatedAt time.Time
}

type Pager

type Pager struct {
	Limit  int64
	Offset int64
}

Pager is a lightweight paging abstraction that we could afford to use only with small databases like SQLLite.

type Repo

type Repo struct{}

func (Repo) ByHash

func (Repo) ByHash(ctx context.Context, run storage.Runner, hash string) (Entity, error)

func (Repo) Delete

func (Repo) Delete(ctx context.Context, run storage.Runner, id int64) error

func (Repo) List

func (Repo) List(ctx context.Context, run storage.Runner, pager Pager) ([]Entity, error)

func (Repo) Persist

func (p Repo) Persist(ctx context.Context, run storage.Runner, entry Entity) (int64, error)

func (Repo) Retrieve

func (p Repo) Retrieve(ctx context.Context, run storage.Runner, id int64) (Entity, error)

Jump to

Keyboard shortcuts

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