Documentation ¶
Overview ¶
Package db is a generated GoMock package.
Index ¶
- type CreatePostParams
- type CreateResetParams
- type CreateUserParams
- type DBTX
- type DeletePostByIDsParams
- type FindPostByIDsParams
- type MockQuerier
- func (m *MockQuerier) CreatePost(ctx context.Context, arg CreatePostParams) (Post, error)
- func (m *MockQuerier) CreateReset(ctx context.Context, arg CreateResetParams) (Reset, error)
- func (m *MockQuerier) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (m *MockQuerier) DeletePostByIDs(ctx context.Context, arg DeletePostByIDsParams) error
- func (m *MockQuerier) DeleteResetsForUser(ctx context.Context, userID int64) error
- func (m *MockQuerier) EXPECT() *MockQuerierMockRecorder
- func (m *MockQuerier) FindPostByIDs(ctx context.Context, arg FindPostByIDsParams) (Post, error)
- func (m *MockQuerier) FindPostsByAuthor(ctx context.Context, authorID int64) ([]Post, error)
- func (m *MockQuerier) FindResetByCode(ctx context.Context, code string) (Reset, error)
- func (m *MockQuerier) FindUserByEmail(ctx context.Context, lower string) (User, error)
- func (m *MockQuerier) FindUserByID(ctx context.Context, id int64) (User, error)
- func (m *MockQuerier) FindUserByVerificationCode(ctx context.Context, verification string) (User, error)
- func (m *MockQuerier) UpdatePost(ctx context.Context, arg UpdatePostParams) (Post, error)
- func (m *MockQuerier) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
- func (m *MockQuerier) UpdateUserStatus(ctx context.Context, arg UpdateUserStatusParams) error
- type MockQuerierMockRecorder
- func (mr *MockQuerierMockRecorder) CreatePost(ctx, arg interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) CreateReset(ctx, arg interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) CreateUser(ctx, arg interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) DeletePostByIDs(ctx, arg interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) DeleteResetsForUser(ctx, userID interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) FindPostByIDs(ctx, arg interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) FindPostsByAuthor(ctx, authorID interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) FindResetByCode(ctx, code interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) FindUserByEmail(ctx, lower interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) FindUserByID(ctx, id interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) FindUserByVerificationCode(ctx, verification interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) UpdatePost(ctx, arg interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) UpdateUserPassword(ctx, arg interface{}) *gomock.Call
- func (mr *MockQuerierMockRecorder) UpdateUserStatus(ctx, arg interface{}) *gomock.Call
- type NullPostStatus
- type NullUserStatus
- type Post
- type PostStatus
- type Querier
- type Queries
- func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (Post, error)
- func (q *Queries) CreateReset(ctx context.Context, arg CreateResetParams) (Reset, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeletePostByIDs(ctx context.Context, arg DeletePostByIDsParams) error
- func (q *Queries) DeleteResetsForUser(ctx context.Context, userID int64) error
- func (q *Queries) FindPostByIDs(ctx context.Context, arg FindPostByIDsParams) (Post, error)
- func (q *Queries) FindPostsByAuthor(ctx context.Context, authorID int64) ([]Post, error)
- func (q *Queries) FindResetByCode(ctx context.Context, code string) (Reset, error)
- func (q *Queries) FindUserByEmail(ctx context.Context, lower string) (User, error)
- func (q *Queries) FindUserByID(ctx context.Context, id int64) (User, error)
- func (q *Queries) FindUserByVerificationCode(ctx context.Context, verification string) (User, error)
- func (q *Queries) UpdatePost(ctx context.Context, arg UpdatePostParams) (Post, error)
- func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
- func (q *Queries) UpdateUserStatus(ctx context.Context, arg UpdateUserStatusParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Reset
- type UpdatePostParams
- type UpdateUserPasswordParams
- type UpdateUserStatusParams
- type User
- type UserStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePostParams ¶
type CreatePostParams struct { AuthorID int64 `json:"author_id"` Title string `json:"title"` Body string `json:"body"` Status PostStatus `json:"status"` }
type CreateResetParams ¶
type CreateUserParams ¶
type CreateUserParams struct { Email string `json:"email"` Salt string `json:"salt"` Pass string `json:"pass"` Status UserStatus `json:"status"` Verification string `json:"verification"` }
type DeletePostByIDsParams ¶
type FindPostByIDsParams ¶
type MockQuerier ¶
type MockQuerier struct {
// contains filtered or unexported fields
}
MockQuerier is a mock of Querier interface.
func NewMockQuerier ¶
func NewMockQuerier(ctrl *gomock.Controller) *MockQuerier
NewMockQuerier creates a new mock instance.
func (*MockQuerier) CreatePost ¶
func (m *MockQuerier) CreatePost(ctx context.Context, arg CreatePostParams) (Post, error)
CreatePost mocks base method.
func (*MockQuerier) CreateReset ¶
func (m *MockQuerier) CreateReset(ctx context.Context, arg CreateResetParams) (Reset, error)
CreateReset mocks base method.
func (*MockQuerier) CreateUser ¶
func (m *MockQuerier) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
CreateUser mocks base method.
func (*MockQuerier) DeletePostByIDs ¶
func (m *MockQuerier) DeletePostByIDs(ctx context.Context, arg DeletePostByIDsParams) error
DeletePostByIDs mocks base method.
func (*MockQuerier) DeleteResetsForUser ¶
func (m *MockQuerier) DeleteResetsForUser(ctx context.Context, userID int64) error
DeleteResetsForUser mocks base method.
func (*MockQuerier) EXPECT ¶
func (m *MockQuerier) EXPECT() *MockQuerierMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockQuerier) FindPostByIDs ¶
func (m *MockQuerier) FindPostByIDs(ctx context.Context, arg FindPostByIDsParams) (Post, error)
FindPostByIDs mocks base method.
func (*MockQuerier) FindPostsByAuthor ¶
FindPostsByAuthor mocks base method.
func (*MockQuerier) FindResetByCode ¶
FindResetByCode mocks base method.
func (*MockQuerier) FindUserByEmail ¶
FindUserByEmail mocks base method.
func (*MockQuerier) FindUserByID ¶
FindUserByID mocks base method.
func (*MockQuerier) FindUserByVerificationCode ¶
func (m *MockQuerier) FindUserByVerificationCode(ctx context.Context, verification string) (User, error)
FindUserByVerificationCode mocks base method.
func (*MockQuerier) UpdatePost ¶
func (m *MockQuerier) UpdatePost(ctx context.Context, arg UpdatePostParams) (Post, error)
UpdatePost mocks base method.
func (*MockQuerier) UpdateUserPassword ¶
func (m *MockQuerier) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
UpdateUserPassword mocks base method.
func (*MockQuerier) UpdateUserStatus ¶
func (m *MockQuerier) UpdateUserStatus(ctx context.Context, arg UpdateUserStatusParams) error
UpdateUserStatus mocks base method.
type MockQuerierMockRecorder ¶
type MockQuerierMockRecorder struct {
// contains filtered or unexported fields
}
MockQuerierMockRecorder is the mock recorder for MockQuerier.
func (*MockQuerierMockRecorder) CreatePost ¶
func (mr *MockQuerierMockRecorder) CreatePost(ctx, arg interface{}) *gomock.Call
CreatePost indicates an expected call of CreatePost.
func (*MockQuerierMockRecorder) CreateReset ¶
func (mr *MockQuerierMockRecorder) CreateReset(ctx, arg interface{}) *gomock.Call
CreateReset indicates an expected call of CreateReset.
func (*MockQuerierMockRecorder) CreateUser ¶
func (mr *MockQuerierMockRecorder) CreateUser(ctx, arg interface{}) *gomock.Call
CreateUser indicates an expected call of CreateUser.
func (*MockQuerierMockRecorder) DeletePostByIDs ¶
func (mr *MockQuerierMockRecorder) DeletePostByIDs(ctx, arg interface{}) *gomock.Call
DeletePostByIDs indicates an expected call of DeletePostByIDs.
func (*MockQuerierMockRecorder) DeleteResetsForUser ¶
func (mr *MockQuerierMockRecorder) DeleteResetsForUser(ctx, userID interface{}) *gomock.Call
DeleteResetsForUser indicates an expected call of DeleteResetsForUser.
func (*MockQuerierMockRecorder) FindPostByIDs ¶
func (mr *MockQuerierMockRecorder) FindPostByIDs(ctx, arg interface{}) *gomock.Call
FindPostByIDs indicates an expected call of FindPostByIDs.
func (*MockQuerierMockRecorder) FindPostsByAuthor ¶
func (mr *MockQuerierMockRecorder) FindPostsByAuthor(ctx, authorID interface{}) *gomock.Call
FindPostsByAuthor indicates an expected call of FindPostsByAuthor.
func (*MockQuerierMockRecorder) FindResetByCode ¶
func (mr *MockQuerierMockRecorder) FindResetByCode(ctx, code interface{}) *gomock.Call
FindResetByCode indicates an expected call of FindResetByCode.
func (*MockQuerierMockRecorder) FindUserByEmail ¶
func (mr *MockQuerierMockRecorder) FindUserByEmail(ctx, lower interface{}) *gomock.Call
FindUserByEmail indicates an expected call of FindUserByEmail.
func (*MockQuerierMockRecorder) FindUserByID ¶
func (mr *MockQuerierMockRecorder) FindUserByID(ctx, id interface{}) *gomock.Call
FindUserByID indicates an expected call of FindUserByID.
func (*MockQuerierMockRecorder) FindUserByVerificationCode ¶
func (mr *MockQuerierMockRecorder) FindUserByVerificationCode(ctx, verification interface{}) *gomock.Call
FindUserByVerificationCode indicates an expected call of FindUserByVerificationCode.
func (*MockQuerierMockRecorder) UpdatePost ¶
func (mr *MockQuerierMockRecorder) UpdatePost(ctx, arg interface{}) *gomock.Call
UpdatePost indicates an expected call of UpdatePost.
func (*MockQuerierMockRecorder) UpdateUserPassword ¶
func (mr *MockQuerierMockRecorder) UpdateUserPassword(ctx, arg interface{}) *gomock.Call
UpdateUserPassword indicates an expected call of UpdateUserPassword.
func (*MockQuerierMockRecorder) UpdateUserStatus ¶
func (mr *MockQuerierMockRecorder) UpdateUserStatus(ctx, arg interface{}) *gomock.Call
UpdateUserStatus indicates an expected call of UpdateUserStatus.
type NullPostStatus ¶
type NullPostStatus struct { PostStatus PostStatus Valid bool // Valid is true if String is not NULL }
func (*NullPostStatus) Scan ¶
func (ns *NullPostStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullUserStatus ¶
type NullUserStatus struct { UserStatus UserStatus Valid bool // Valid is true if String is not NULL }
func (*NullUserStatus) Scan ¶
func (ns *NullUserStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type PostStatus ¶
type PostStatus string
const ( PostStatusDraft PostStatus = "draft" PostStatusPublished PostStatus = "published" )
func (*PostStatus) Scan ¶
func (e *PostStatus) Scan(src interface{}) error
type Querier ¶
type Querier interface { CreatePost(ctx context.Context, arg CreatePostParams) (Post, error) CreateReset(ctx context.Context, arg CreateResetParams) (Reset, error) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) DeletePostByIDs(ctx context.Context, arg DeletePostByIDsParams) error DeleteResetsForUser(ctx context.Context, userID int64) error FindPostByIDs(ctx context.Context, arg FindPostByIDsParams) (Post, error) FindPostsByAuthor(ctx context.Context, authorID int64) ([]Post, error) FindResetByCode(ctx context.Context, code string) (Reset, error) FindUserByEmail(ctx context.Context, lower string) (User, error) FindUserByID(ctx context.Context, id int64) (User, error) FindUserByVerificationCode(ctx context.Context, verification string) (User, error) UpdatePost(ctx context.Context, arg UpdatePostParams) (Post, error) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error UpdateUserStatus(ctx context.Context, arg UpdateUserStatusParams) error }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreatePost ¶
func (*Queries) CreateReset ¶
func (*Queries) CreateUser ¶
func (*Queries) DeletePostByIDs ¶
func (q *Queries) DeletePostByIDs(ctx context.Context, arg DeletePostByIDsParams) error
func (*Queries) DeleteResetsForUser ¶
func (*Queries) FindPostByIDs ¶
func (*Queries) FindPostsByAuthor ¶
func (*Queries) FindResetByCode ¶
func (*Queries) FindUserByEmail ¶
func (*Queries) FindUserByID ¶
func (*Queries) FindUserByVerificationCode ¶
func (*Queries) UpdatePost ¶
func (*Queries) UpdateUserPassword ¶
func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
func (*Queries) UpdateUserStatus ¶
func (q *Queries) UpdateUserStatus(ctx context.Context, arg UpdateUserStatusParams) error
type UpdatePostParams ¶
type UpdateUserStatusParams ¶
type UpdateUserStatusParams struct { ID int64 `json:"id"` Status UserStatus `json:"status"` }
type User ¶
type User struct { ID int64 `json:"id"` Email string `json:"email"` Pass string `json:"pass"` Salt string `json:"salt"` Status UserStatus `json:"status"` Verification string `json:"verification"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (User) MarshalJSON ¶
MarshalJSON here protects "private" fields from ever being sent *out*
type UserStatus ¶
type UserStatus string
const ( UserStatusDisabled UserStatus = "disabled" UserStatusUnverified UserStatus = "unverified" UserStatusActive UserStatus = "active" )
func (*UserStatus) Scan ¶
func (e *UserStatus) Scan(src interface{}) error