Documentation ¶
Index ¶
- func CreateComment(joke_id uint, c *CommentRequest) error
- func CreateJoke(j *JokeRequest) error
- func DeleteComment(id uint) error
- func DeleteJokeById(id uint) error
- func DeleteUserByName(name string) error
- func FetchAllComments(joke_id uint) (*[]CommentRequest, error)
- func FetchAllJokes(limit int, page int, sort string) (*[]JokeRequest, uint, error)
- func FetchJokesByAuthor(author string) (*[]JokeRequest, error)
- func FetchTopRatedJokes(limit int) (*[]JokeRequest, error)
- func LoginUser(u *User) error
- func RegisterUser(u *User) error
- func UpdateComment(id uint, c *CommentRequest) error
- func UpdateJoke(id uint, j *JokeRequest) error
- type Comment
- type CommentRequest
- type Joke
- type JokeRequest
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateComment ¶
func CreateComment(joke_id uint, c *CommentRequest) error
func CreateJoke ¶
func CreateJoke(j *JokeRequest) error
func DeleteComment ¶
func DeleteJokeById ¶
func DeleteUserByName ¶
func FetchAllComments ¶
func FetchAllComments(joke_id uint) (*[]CommentRequest, error)
func FetchAllJokes ¶
func FetchJokesByAuthor ¶
func FetchJokesByAuthor(author string) (*[]JokeRequest, error)
func FetchTopRatedJokes ¶
func FetchTopRatedJokes(limit int) (*[]JokeRequest, error)
func RegisterUser ¶
func UpdateComment ¶
func UpdateComment(id uint, c *CommentRequest) error
func UpdateJoke ¶
func UpdateJoke(id uint, j *JokeRequest) error
Types ¶
type CommentRequest ¶
type CommentRequest struct { ID uint `json:"id"` Content string `json:"content"` Author string `json:"author"` }
func FetchCommentById ¶
func FetchCommentById(id uint) (*CommentRequest, error)
type JokeRequest ¶
type JokeRequest struct { ID uint `json:"id"` Content string `json:"content"` Author string `json:"author"` Rating uint `json:"rating"` }
func FetchAJoke ¶
func FetchAJoke(id uint) (*JokeRequest, error)
func FetchRandomJoke ¶
func FetchRandomJoke() (*JokeRequest, error)
Click to show internal directories.
Click to hide internal directories.