Documentation
¶
Index ¶
- type Comments
- type CountCommentsByPostRow
- type DBTX
- type GetCommentRow
- type GetPostRow
- type GetPostsForTagRow
- type GetTagByNameRow
- type GetTagRow
- type GetTagsForPostRow
- type GetUserByEmailRow
- type GetUserRow
- type ListCommentsByPostRow
- type ListCommentsByUserRow
- type ListPostsByUserRow
- type ListPostsRow
- type ListTagsRow
- type ListUsersRow
- type Posts
- type Querier
- type Queries
- func (q *Queries) AddTagToPost(ctx context.Context, postId int32, tagId int32) (sql.Result, error)
- func (q *Queries) CountCommentsByPost(ctx context.Context, postId int32) (CountCommentsByPostRow, error)
- func (q *Queries) CreateComment(ctx context.Context, postId int32, userId int32, content string) (QueryResult, error)
- func (q *Queries) CreatePost(ctx context.Context, userId int32, title string, content sql.NullString, ...) (QueryResult, error)
- func (q *Queries) CreateTag(ctx context.Context, name string, description sql.NullString) (QueryResult, error)
- func (q *Queries) CreateUser(ctx context.Context, email string, username string, passwordHash string, ...) (QueryResult, error)
- func (q *Queries) DeleteComment(ctx context.Context, id int32) (sql.Result, error)
- func (q *Queries) DeletePost(ctx context.Context, id int32) (sql.Result, error)
- func (q *Queries) DeleteTag(ctx context.Context, id int32) (sql.Result, error)
- func (q *Queries) GetComment(ctx context.Context, id int32) (GetCommentRow, error)
- func (q *Queries) GetPost(ctx context.Context, id int32) (GetPostRow, error)
- func (q *Queries) GetPostsForTag(ctx context.Context, tagId int32, limit *any) ([]GetPostsForTagRow, error)
- func (q *Queries) GetTag(ctx context.Context, id int32) (GetTagRow, error)
- func (q *Queries) GetTagByName(ctx context.Context, name string) (GetTagByNameRow, error)
- func (q *Queries) GetTagsForPost(ctx context.Context, postId int32) ([]GetTagsForPostRow, error)
- func (q *Queries) GetUser(ctx context.Context, id int32) (GetUserRow, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)
- func (q *Queries) IncrementPostViews(ctx context.Context, id int32) (sql.Result, error)
- func (q *Queries) ListCommentsByPost(ctx context.Context, postId int32, limit *any) ([]ListCommentsByPostRow, error)
- func (q *Queries) ListCommentsByUser(ctx context.Context, userId int32, limit *any) ([]ListCommentsByUserRow, error)
- func (q *Queries) ListPosts(ctx context.Context, status sql.NullString, limit *any) ([]ListPostsRow, error)
- func (q *Queries) ListPostsByUser(ctx context.Context, userId int32, status sql.NullString, limit *any) ([]ListPostsByUserRow, error)
- func (q *Queries) ListTags(ctx context.Context) ([]ListTagsRow, error)
- func (q *Queries) ListUsers(ctx context.Context, status sql.NullString, limit *any) ([]ListUsersRow, error)
- func (q *Queries) RemoveTagFromPost(ctx context.Context, postId int32, tagId int32) (sql.Result, error)
- func (q *Queries) UpdatePost(ctx context.Context, title string, content sql.NullString, ...) (sql.Result, error)
- type QueryResult
- type Tags
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountCommentsByPostRow ¶
type CountCommentsByPostRow struct {
Count int64
}
type GetCommentRow ¶
type GetPostRow ¶
type GetPostRow struct {
Id int32
UserId int32
Title string
Content sql.NullString
Status sql.NullString
ViewCount *int32
CreatedAt sql.NullString
}
type GetPostsForTagRow ¶
type GetPostsForTagRow struct {
Id int32
UserId int32
Title string
Content sql.NullString
Status sql.NullString
ViewCount *int32
CreatedAt sql.NullString
}
type GetTagByNameRow ¶
type GetTagByNameRow struct {
Id int32
Name string
Description sql.NullString
CreatedAt sql.NullString
}
type GetTagRow ¶
type GetTagRow struct {
Id int32
Name string
Description sql.NullString
CreatedAt sql.NullString
}
type GetTagsForPostRow ¶
type GetTagsForPostRow struct {
Id int32
Name string
Description sql.NullString
CreatedAt sql.NullString
}
type GetUserByEmailRow ¶
type GetUserByEmailRow struct {
Id int32
Email string
Username string
PasswordHash string
Status sql.NullString
CreatedAt sql.NullString
}
type GetUserRow ¶
type GetUserRow struct {
Id int32
Email string
Username string
PasswordHash string
Status sql.NullString
CreatedAt sql.NullString
}
type ListCommentsByPostRow ¶
type ListCommentsByUserRow ¶
type ListPostsByUserRow ¶
type ListPostsByUserRow struct {
Id int32
UserId int32
Title string
Content sql.NullString
Status sql.NullString
ViewCount *int32
CreatedAt sql.NullString
}
type ListPostsRow ¶
type ListPostsRow struct {
Id int32
UserId int32
Title string
Content sql.NullString
Status sql.NullString
ViewCount *int32
CreatedAt sql.NullString
}
type ListTagsRow ¶
type ListTagsRow struct {
Id int32
Name string
Description sql.NullString
CreatedAt sql.NullString
}
type ListUsersRow ¶
type ListUsersRow struct {
Id int32
Email string
Username string
PasswordHash string
Status sql.NullString
CreatedAt sql.NullString
}
type Posts ¶
type Posts struct {
Id int32 `json:"id"`
UserId int32 `json:"user_id"`
Title string `json:"title"`
Content sql.NullString `json:"content"`
Status sql.NullString `json:"status"`
ViewCount *int32 `json:"view_count"`
CreatedAt sql.NullString `json:"created_at"`
}
type Querier ¶
type Querier interface {
AddTagToPost(ctx context.Context, postId int32, tagId int32) (sql.Result, error)
CountCommentsByPost(ctx context.Context, postId int32) (CountCommentsByPostRow, error)
CreateComment(ctx context.Context, postId int32, userId int32, content string) (QueryResult, error)
CreatePost(ctx context.Context, userId int32, title string, content sql.NullString, status sql.NullString) (QueryResult, error)
CreateTag(ctx context.Context, name string, description sql.NullString) (QueryResult, error)
CreateUser(ctx context.Context, email string, username string, passwordHash string, status sql.NullString) (QueryResult, error)
DeleteComment(ctx context.Context, id int32) (sql.Result, error)
DeletePost(ctx context.Context, id int32) (sql.Result, error)
DeleteTag(ctx context.Context, id int32) (sql.Result, error)
GetComment(ctx context.Context, id int32) (GetCommentRow, error)
GetPost(ctx context.Context, id int32) (GetPostRow, error)
GetPostsForTag(ctx context.Context, tagId int32, limit *any) ([]GetPostsForTagRow, error)
GetTag(ctx context.Context, id int32) (GetTagRow, error)
GetTagByName(ctx context.Context, name string) (GetTagByNameRow, error)
GetTagsForPost(ctx context.Context, postId int32) ([]GetTagsForPostRow, error)
GetUser(ctx context.Context, id int32) (GetUserRow, error)
GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)
IncrementPostViews(ctx context.Context, id int32) (sql.Result, error)
ListCommentsByPost(ctx context.Context, postId int32, limit *any) ([]ListCommentsByPostRow, error)
ListCommentsByUser(ctx context.Context, userId int32, limit *any) ([]ListCommentsByUserRow, error)
ListPosts(ctx context.Context, status sql.NullString, limit *any) ([]ListPostsRow, error)
ListPostsByUser(ctx context.Context, userId int32, status sql.NullString, limit *any) ([]ListPostsByUserRow, error)
ListTags(ctx context.Context) ([]ListTagsRow, error)
ListUsers(ctx context.Context, status sql.NullString, limit *any) ([]ListUsersRow, error)
RemoveTagFromPost(ctx context.Context, postId int32, tagId int32) (sql.Result, error)
UpdatePost(ctx context.Context, title string, content sql.NullString, status sql.NullString, id int32) (sql.Result, error)
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddTagToPost ¶
func (*Queries) CountCommentsByPost ¶
func (*Queries) CreateComment ¶
func (*Queries) CreatePost ¶
func (q *Queries) CreatePost(ctx context.Context, userId int32, title string, content sql.NullString, status sql.NullString) (QueryResult, error)
func (*Queries) CreateTag ¶
func (q *Queries) CreateTag(ctx context.Context, name string, description sql.NullString) (QueryResult, error)
func (*Queries) CreateUser ¶
func (q *Queries) CreateUser(ctx context.Context, email string, username string, passwordHash string, status sql.NullString) (QueryResult, error)
func (*Queries) DeleteComment ¶
func (*Queries) DeletePost ¶
func (*Queries) GetComment ¶
func (*Queries) GetPostsForTag ¶
func (*Queries) GetTagByName ¶
func (*Queries) GetTagsForPost ¶
func (*Queries) GetUserByEmail ¶
func (*Queries) IncrementPostViews ¶
func (*Queries) ListCommentsByPost ¶
func (*Queries) ListCommentsByUser ¶
func (*Queries) ListPosts ¶
func (q *Queries) ListPosts(ctx context.Context, status sql.NullString, limit *any) ([]ListPostsRow, error)
func (*Queries) ListPostsByUser ¶
func (q *Queries) ListPostsByUser(ctx context.Context, userId int32, status sql.NullString, limit *any) ([]ListPostsByUserRow, error)
func (*Queries) ListUsers ¶
func (q *Queries) ListUsers(ctx context.Context, status sql.NullString, limit *any) ([]ListUsersRow, error)
func (*Queries) RemoveTagFromPost ¶
func (*Queries) UpdatePost ¶
type QueryResult ¶
type Tags ¶
type Tags struct {
Id int32 `json:"id"`
Name string `json:"name"`
Description sql.NullString `json:"description"`
CreatedAt sql.NullString `json:"created_at"`
}
type Users ¶
type Users struct {
Id int32 `json:"id"`
Email string `json:"email"`
Username string `json:"username"`
PasswordHash string `json:"password_hash"`
Status sql.NullString `json:"status"`
CreatedAt sql.NullString `json:"created_at"`
}
Source Files
¶
- helpers.gen.go
- models.gen.go
- querier.gen.go
- query_add_tag_to_post.go
- query_count_comments_by_post.go
- query_create_comment.go
- query_create_post.go
- query_create_tag.go
- query_create_user.go
- query_delete_comment.go
- query_delete_post.go
- query_delete_tag.go
- query_get_comment.go
- query_get_post.go
- query_get_posts_for_tag.go
- query_get_tag.go
- query_get_tag_by_name.go
- query_get_tags_for_post.go
- query_get_user.go
- query_get_user_by_email.go
- query_increment_post_views.go
- query_list_comments_by_post.go
- query_list_comments_by_user.go
- query_list_posts.go
- query_list_posts_by_user.go
- query_list_tags.go
- query_list_users.go
- query_remove_tag_from_post.go
- query_update_post.go
Click to show internal directories.
Click to hide internal directories.