Documentation
¶
Index ¶
- type AddTagToPostParams
- type Comments
- type CreateCommentParams
- type CreatePostParams
- type CreateTagParams
- type CreateUserParams
- type DBTX
- type GetCommentRow
- type GetPostRow
- type GetPostsForTagParams
- type GetPostsForTagRow
- type GetTagByNameRow
- type GetTagRow
- type GetTagsForPostRow
- type GetUserByEmailRow
- type GetUserRow
- type ListCommentsByPostParams
- type ListCommentsByPostRow
- type ListCommentsByUserParams
- type ListCommentsByUserRow
- type ListPostsByUserParams
- type ListPostsByUserRow
- type ListPostsParams
- type ListPostsRow
- type ListTagsRow
- type ListUsersParams
- type ListUsersRow
- type Posts
- type Querier
- type Queries
- func (q *Queries) AddTagToPost(ctx context.Context, arg AddTagToPostParams) error
- func (q *Queries) CountCommentsByPost(ctx context.Context, postId int32) (int64, error)
- func (q *Queries) CreateComment(ctx context.Context, arg CreateCommentParams) (QueryResult, error)
- func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (QueryResult, error)
- func (q *Queries) CreateTag(ctx context.Context, arg CreateTagParams) (QueryResult, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (QueryResult, error)
- func (q *Queries) DeleteComment(ctx context.Context, id int32) error
- func (q *Queries) DeletePost(ctx context.Context, id int32) error
- func (q *Queries) DeleteTag(ctx context.Context, id int32) 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, arg GetPostsForTagParams) ([]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) error
- func (q *Queries) ListCommentsByPost(ctx context.Context, arg ListCommentsByPostParams) ([]ListCommentsByPostRow, error)
- func (q *Queries) ListCommentsByUser(ctx context.Context, arg ListCommentsByUserParams) ([]ListCommentsByUserRow, error)
- func (q *Queries) ListPosts(ctx context.Context, arg ListPostsParams) ([]ListPostsRow, error)
- func (q *Queries) ListPostsByUser(ctx context.Context, arg ListPostsByUserParams) ([]ListPostsByUserRow, error)
- func (q *Queries) ListTags(ctx context.Context) ([]ListTagsRow, error)
- func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]ListUsersRow, error)
- func (q *Queries) RemoveTagFromPost(ctx context.Context, arg RemoveTagFromPostParams) error
- func (q *Queries) UpdatePost(ctx context.Context, arg UpdatePostParams) error
- func (q *Queries) WithTx(tx DBTX) *Queries
- type QueryResult
- type RemoveTagFromPostParams
- type Tags
- type UpdatePostParams
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddTagToPostParams ¶ added in v0.11.0
type CreateCommentParams ¶ added in v0.11.0
type CreatePostParams ¶ added in v0.11.0
type CreatePostParams struct {
UserId int32
Title string
Content sql.NullString
Status sql.NullString
}
type CreateTagParams ¶ added in v0.11.0
type CreateTagParams struct {
Name string
Description sql.NullString
}
type CreateUserParams ¶ added in v0.11.0
type CreateUserParams struct {
Email string
Username string
PasswordHash string
Status sql.NullString
}
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 GetPostsForTagParams ¶ added in v0.11.0
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 ListCommentsByPostParams ¶ added in v0.11.0
type ListCommentsByPostRow ¶
type ListCommentsByUserParams ¶ added in v0.11.0
type ListCommentsByUserRow ¶
type ListPostsByUserParams ¶ added in v0.11.0
type ListPostsByUserParams struct {
UserId int32
Status sql.NullString
Limit any
}
type ListPostsByUserRow ¶
type ListPostsByUserRow struct {
Id int32
UserId int32
Title string
Content sql.NullString
Status sql.NullString
ViewCount *int32
CreatedAt sql.NullString
}
type ListPostsParams ¶ added in v0.11.0
type ListPostsParams struct {
Status sql.NullString
Limit any
}
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 ListUsersParams ¶ added in v0.11.0
type ListUsersParams struct {
Status sql.NullString
Limit any
}
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, arg AddTagToPostParams) error
CountCommentsByPost(ctx context.Context, postId int32) (int64, error)
CreateComment(ctx context.Context, arg CreateCommentParams) (QueryResult, error)
CreatePost(ctx context.Context, arg CreatePostParams) (QueryResult, error)
CreateTag(ctx context.Context, arg CreateTagParams) (QueryResult, error)
CreateUser(ctx context.Context, arg CreateUserParams) (QueryResult, error)
DeleteComment(ctx context.Context, id int32) error
DeletePost(ctx context.Context, id int32) error
DeleteTag(ctx context.Context, id int32) error
GetComment(ctx context.Context, id int32) (GetCommentRow, error)
GetPost(ctx context.Context, id int32) (GetPostRow, error)
GetPostsForTag(ctx context.Context, arg GetPostsForTagParams) ([]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) error
ListCommentsByPost(ctx context.Context, arg ListCommentsByPostParams) ([]ListCommentsByPostRow, error)
ListCommentsByUser(ctx context.Context, arg ListCommentsByUserParams) ([]ListCommentsByUserRow, error)
ListPosts(ctx context.Context, arg ListPostsParams) ([]ListPostsRow, error)
ListPostsByUser(ctx context.Context, arg ListPostsByUserParams) ([]ListPostsByUserRow, error)
ListTags(ctx context.Context) ([]ListTagsRow, error)
ListUsers(ctx context.Context, arg ListUsersParams) ([]ListUsersRow, error)
RemoveTagFromPost(ctx context.Context, arg RemoveTagFromPostParams) error
UpdatePost(ctx context.Context, arg UpdatePostParams) error
WithTx(tx DBTX) *Queries
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddTagToPost ¶
func (q *Queries) AddTagToPost(ctx context.Context, arg AddTagToPostParams) error
func (*Queries) CountCommentsByPost ¶
func (*Queries) CreateComment ¶
func (q *Queries) CreateComment(ctx context.Context, arg CreateCommentParams) (QueryResult, error)
func (*Queries) CreatePost ¶
func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (QueryResult, error)
func (*Queries) CreateTag ¶
func (q *Queries) CreateTag(ctx context.Context, arg CreateTagParams) (QueryResult, error)
func (*Queries) CreateUser ¶
func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (QueryResult, error)
func (*Queries) DeleteComment ¶
func (*Queries) GetComment ¶
func (*Queries) GetPostsForTag ¶
func (q *Queries) GetPostsForTag(ctx context.Context, arg GetPostsForTagParams) ([]GetPostsForTagRow, error)
func (*Queries) GetTagByName ¶
func (*Queries) GetTagsForPost ¶
func (*Queries) GetUserByEmail ¶
func (*Queries) IncrementPostViews ¶
func (*Queries) ListCommentsByPost ¶
func (q *Queries) ListCommentsByPost(ctx context.Context, arg ListCommentsByPostParams) ([]ListCommentsByPostRow, error)
func (*Queries) ListCommentsByUser ¶
func (q *Queries) ListCommentsByUser(ctx context.Context, arg ListCommentsByUserParams) ([]ListCommentsByUserRow, error)
func (*Queries) ListPosts ¶
func (q *Queries) ListPosts(ctx context.Context, arg ListPostsParams) ([]ListPostsRow, error)
func (*Queries) ListPostsByUser ¶
func (q *Queries) ListPostsByUser(ctx context.Context, arg ListPostsByUserParams) ([]ListPostsByUserRow, error)
func (*Queries) ListUsers ¶
func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]ListUsersRow, error)
func (*Queries) RemoveTagFromPost ¶
func (q *Queries) RemoveTagFromPost(ctx context.Context, arg RemoveTagFromPostParams) error
func (*Queries) UpdatePost ¶
func (q *Queries) UpdatePost(ctx context.Context, arg UpdatePostParams) error
type QueryResult ¶
type RemoveTagFromPostParams ¶ added in v0.11.0
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 UpdatePostParams ¶ added in v0.11.0
type UpdatePostParams struct {
Title string
Content sql.NullString
Status sql.NullString
Id int32
}
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.