dynamodbstorage

package
v0.0.0-...-0502d0a Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

package dynamodbstorage provides a client for storing shortlinks in Amazon DynamoDB.

The primary key is `pk` and the sort key is `sk`.

Shortlinks have a `pk` of "s", and `sk` of their From value.

Deleted shortlinks are exactly the same but with a `pk` of "d".

History (previous versions of shortlinks) have a `pk` of "h" with their From value appended (ie the history of the "frew" shortlink has a `pk` of "hfrew") and an `sk` of the RFC3339 representation of the time that history was created.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	DB *dynamodb.Client

	Table string
}
func (cl *Client) AllShortlinks() ([]shortlinks.Shortlink, error)
func (cl *Client) CreateShortlink(sl shortlinks.Shortlink) error
func (cl *Client) DeleteShortlink(from, who string) error
func (cl *Client) DeletedShortlinks() ([]shortlinks.Shortlink, error)

func (*Client) History

func (cl *Client) History(from string) ([]shortlinks.History, error)

func (*Client) InsertHistory

func (cl *Client) InsertHistory(h shortlinks.History) error
func (cl *Client) Shortlink(from string) (shortlinks.Shortlink, error)

Jump to

Keyboard shortcuts

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