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 ¶
- type Client
- 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 (cl *Client) History(from string) ([]shortlinks.History, error)
- func (cl *Client) InsertHistory(h shortlinks.History) error
- func (cl *Client) Shortlink(from string) (shortlinks.Shortlink, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) AllShortlinks ¶
func (cl *Client) AllShortlinks() ([]shortlinks.Shortlink, error)
func (*Client) CreateShortlink ¶
func (cl *Client) CreateShortlink(sl shortlinks.Shortlink) error
func (*Client) DeleteShortlink ¶
func (*Client) DeletedShortlinks ¶
func (cl *Client) DeletedShortlinks() ([]shortlinks.Shortlink, error)
func (*Client) InsertHistory ¶
func (cl *Client) InsertHistory(h shortlinks.History) error
Click to show internal directories.
Click to hide internal directories.