post

package
v0.0.0-...-fff4dcd Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*dynamo.Client
}

Client ...

func New

func New(
	tableName,
	endpoint string,
	provider dynamo.Provider,
) *Client

New creates new Client instance

func (*Client) CreatePost

func (c *Client) CreatePost(params map[string]interface{}) *Post

CreatePost creates a new post

func (*Client) GetCount

func (c *Client) GetCount() int64

GetCount gets the total number of item in the table

func (*Client) GetPost

func (c *Client) GetPost(id string) *Post

GetPost ...

func (*Client) GetPosts

func (c *Client) GetPosts() []*Post

GetPosts ...

func (*Client) GetUserPosts

func (c *Client) GetUserPosts(username string) []*Post

GetUserPosts gets all the posts from user

func (*Client) UpdatePost

func (c *Client) UpdatePost(
	id,
	cover,
	content string,
	created int64,
) error

UpdatePost ...

type Post

type Post struct {
	ID       string `json:"id"`
	Title    string `json:"title"`
	Author   string `json:"author"`
	Username string `json:"username"`
	UserPic  string `json:"userpic"`
	Created  int64  `json:"created"`
	Updated  int64  `json:"updated"`
	Publish  int    `json:"publish"`
	Content  string `json:"content"`
}

Post ...

Jump to

Keyboard shortcuts

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