dynamodb

package
v0.0.0-...-ea9379f Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

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

Repo represents a repository for blog posts that uses DynamoDB.

func New

func New() Repo

New returns a new repository instance for blog posts that uses DynamoDB.

func (*Repo) Create

func (repo *Repo) Create(post model.BlogPost) (model.BlogPost, error)

Create creates a new blog post in the database.

func (*Repo) Delete

func (repo *Repo) Delete(id string) (bool, error)

Delete deletes a blog post from the database.

func (*Repo) Get

func (repo *Repo) Get(id string) (model.BlogPost, bool, error)

Get searches and returns a blog post based on its id.

func (*Repo) GetAll

func (repo *Repo) GetAll(pageSize int64) ([]model.BlogPost, error)

GetAll loads all blog posts from the database.

func (*Repo) GetMore

func (repo *Repo) GetMore(lastID string, pageSize int64) ([]model.BlogPost, error)

GetMore loads more blog posts from the database.

func (*Repo) Update

func (repo *Repo) Update(revision int64, post model.BlogPost) (model.BlogPost, error)

Update updates an existing blog post in the database.

Jump to

Keyboard shortcuts

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