Documentation ¶
Overview ¶
Package model provides basic types for the data model of posty.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByCreatedAtDESC ¶
type ByCreatedAtDESC []*Post
ByCreatedAtDESC represents a sort interface for sorting Posts descendingby CreatedAt
func (ByCreatedAtDESC) Less ¶
func (o ByCreatedAtDESC) Less(i, j int) bool
Less defines the comparator of posts
func (ByCreatedAtDESC) Swap ¶
func (o ByCreatedAtDESC) Swap(i, j int)
Swap swaps two items in the slice
type Post ¶
type Post struct { ID string UID string Username string Message string CreatedAt time.Time IsNew bool Peer PostPeer }
Post represents a users post send to the board
type PostPeer ¶
type PostPeer interface { GetByID(id string) (*Post, error) GetPosts() ([]*Post, error) NewPost(uid string) *Post SaveNew(p *Post) error Remove(p *Post) error }
PostPeer defines interactions with the post data.
Directories ¶
Path | Synopsis |
---|---|
Package awsdynamo implements `posty/model` persistence for the aws dynamodb database
|
Package awsdynamo implements `posty/model` persistence for the aws dynamodb database |
integrationtest
Package integrationtest provides tests interacting with a dynamodb endpoint.
|
Package integrationtest provides tests interacting with a dynamodb endpoint. |
Click to show internal directories.
Click to hide internal directories.