Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostAPI ¶
type PostAPI struct {
DB PostDatabase
}
The PostAPI provides handlers for managing posts.
func (*PostAPI) CreatePost ¶
CreatePost creates a post.
func (*PostAPI) DeletePostByID ¶
DeletePostByID deletes the post by id
func (*PostAPI) GetPostByID ¶
GetPostByID returns the post by id
func (*PostAPI) GetPosts ¶
GetPosts returns all the posts _end=5&_order=DESC&_sort=id&_start=0 adapt react-admin
func (*PostAPI) UpdatePostByID ¶
UpdatePostByID is
type PostDatabase ¶
type PostDatabase interface { GetPosts(paging *model.Paging) []*model.Post GetPostByID(id primitive.ObjectID) *model.Post CreatePost(post *model.Post) *model.Post UpdatePost(post *model.Post) *model.Post DeletePostByID(id primitive.ObjectID) error CountPost(condition interface{}) string }
The PostDatabase interface for encapsulating database access.
type UserAPI ¶
type UserAPI struct {
DB UserDatabase
}
The UserAPI provides handlers for managing users.
func (*UserAPI) DeleteUserByID ¶
DeleteUserByID deletes the user by id
func (*UserAPI) GetUserByIDs ¶
GetUserByIDs returns the user by id
type UserDatabase ¶
type UserDatabase interface { GetUserByIDs(ids []primitive.ObjectID) []*model.User DeleteUserByID(id primitive.ObjectID) error CreateUser(user *model.User) error GetUsers(paging *model.Paging) []*model.User CountUser() string }
The UserDatabase interface for encapsulating database access.
Click to show internal directories.
Click to hide internal directories.