func AllPosts() []interface{} {
	postMx.RLock()
	defer postMx.RUnlock()
	posts := make([]interface{}, 0)
	for _, post := range postStore {
		posts = append(posts, ToPostAlias(post))
	}
	return posts
}
AllPosts returns all the posts.
package models
import (
	"errors"
	"sync"
	"time"
)
var (
	postStore  = make(map[int64]*Post)
	lastPostID int64
	idMx       = &sync.Mutex{}
	postMx     = &sync.RWMutex{}
)
type Post struct {
	ID        int64     `json:"id,omitempty"`
	Title     string    `json:"title,omitempty"`
	Body      string    `json:"body,omitempty"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
}
type PostAlias Post