Documentation ¶
Overview ¶
Package store defines the store layer of dazBlog
Package store is a generated GoMock package.
Index ¶
- Variables
- func NewStore(db *gorm.DB) *datastore
- type AIStore
- type IStore
- type MockAIStore
- func (m *MockAIStore) Create(arg0 context.Context, arg1 *model.AIM) error
- func (m *MockAIStore) Delete(arg0 context.Context, arg1, arg2 string) error
- func (m *MockAIStore) EXPECT() *MockAIStoreMockRecorder
- func (m *MockAIStore) Get(arg0 context.Context, arg1, arg2 string) (*model.AIM, error)
- func (m *MockAIStore) List(arg0 context.Context, arg1 string, arg2, arg3 int) (int64, []*model.AIM, error)
- func (m *MockAIStore) Update(arg0 context.Context, arg1 *model.AIM) error
- type MockAIStoreMockRecorder
- func (mr *MockAIStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockAIStoreMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockAIStoreMockRecorder) Get(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockAIStoreMockRecorder) List(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockAIStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
- type MockIStore
- type MockIStoreMockRecorder
- type MockPostStore
- func (m *MockPostStore) Create(arg0 context.Context, arg1 *model.PostM) error
- func (m *MockPostStore) Delete(arg0 context.Context, arg1 string, arg2 []string) error
- func (m *MockPostStore) EXPECT() *MockPostStoreMockRecorder
- func (m *MockPostStore) Get(arg0 context.Context, arg1, arg2 string) (*model.PostM, error)
- func (m *MockPostStore) List(arg0 context.Context, arg1 string, arg2, arg3 int) (int64, []*model.PostM, error)
- func (m *MockPostStore) Update(arg0 context.Context, arg1 *model.PostM) error
- type MockPostStoreMockRecorder
- func (mr *MockPostStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockPostStoreMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockPostStoreMockRecorder) Get(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockPostStoreMockRecorder) List(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockPostStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
- type MockUserStore
- func (m *MockUserStore) Create(arg0 context.Context, arg1 *model.UserM) error
- func (m *MockUserStore) Delete(arg0 context.Context, arg1 string) error
- func (m *MockUserStore) EXPECT() *MockUserStoreMockRecorder
- func (m *MockUserStore) Get(arg0 context.Context, arg1 string) (*model.UserM, error)
- func (m *MockUserStore) List(arg0 context.Context, arg1, arg2 int) (int64, []*model.UserM, error)
- func (m *MockUserStore) Update(arg0 context.Context, arg1 *model.UserM) error
- type MockUserStoreMockRecorder
- func (mr *MockUserStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockUserStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockUserStoreMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockUserStoreMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockUserStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
- type PostStore
- type UserStore
Constants ¶
This section is empty.
Variables ¶
var (
// S global variable used for easy access to the initialized instance of store layer by other packages
S *datastore
)
Functions ¶
Types ¶
type AIStore ¶
type AIStore interface { Create(ctx context.Context, ai *model.AIM) error Get(ctx context.Context, username string, postID string) (*model.AIM, error) Update(ctx context.Context, ai *model.AIM) error List(ctx context.Context, username string, offset, limit int) (int64, []*model.AIM, error) Delete(ctx context.Context, username string, postID string) error }
type IStore ¶
IStore defines the methods that need to be implemented by the Store layer such as IStore defines Users, Users defines the specific methods
type MockAIStore ¶
type MockAIStore struct {
// contains filtered or unexported fields
}
MockAIStore is a mock of AIStore interface.
func NewMockAIStore ¶
func NewMockAIStore(ctrl *gomock.Controller) *MockAIStore
NewMockAIStore creates a new mock instance.
func (*MockAIStore) Delete ¶
func (m *MockAIStore) Delete(arg0 context.Context, arg1, arg2 string) error
Delete mocks base method.
func (*MockAIStore) EXPECT ¶
func (m *MockAIStore) EXPECT() *MockAIStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockAIStoreMockRecorder ¶
type MockAIStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockAIStoreMockRecorder is the mock recorder for MockAIStore.
func (*MockAIStoreMockRecorder) Create ¶
func (mr *MockAIStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockAIStoreMockRecorder) Delete ¶
func (mr *MockAIStoreMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockAIStoreMockRecorder) Get ¶
func (mr *MockAIStoreMockRecorder) Get(arg0, arg1, arg2 interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockAIStoreMockRecorder) List ¶
func (mr *MockAIStoreMockRecorder) List(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockAIStoreMockRecorder) Update ¶
func (mr *MockAIStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
Update indicates an expected call of Update.
type MockIStore ¶
type MockIStore struct {
// contains filtered or unexported fields
}
MockIStore is a mock of IStore interface.
func NewMockIStore ¶
func NewMockIStore(ctrl *gomock.Controller) *MockIStore
NewMockIStore creates a new mock instance.
func (*MockIStore) EXPECT ¶
func (m *MockIStore) EXPECT() *MockIStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockIStoreMockRecorder ¶
type MockIStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockIStoreMockRecorder is the mock recorder for MockIStore.
func (*MockIStoreMockRecorder) AIs ¶
func (mr *MockIStoreMockRecorder) AIs() *gomock.Call
AIs indicates an expected call of AIs.
func (*MockIStoreMockRecorder) DB ¶
func (mr *MockIStoreMockRecorder) DB() *gomock.Call
DB indicates an expected call of DB.
func (*MockIStoreMockRecorder) Posts ¶
func (mr *MockIStoreMockRecorder) Posts() *gomock.Call
Posts indicates an expected call of Posts.
func (*MockIStoreMockRecorder) Users ¶
func (mr *MockIStoreMockRecorder) Users() *gomock.Call
Users indicates an expected call of Users.
type MockPostStore ¶
type MockPostStore struct {
// contains filtered or unexported fields
}
MockPostStore is a mock of PostStore interface.
func NewMockPostStore ¶
func NewMockPostStore(ctrl *gomock.Controller) *MockPostStore
NewMockPostStore creates a new mock instance.
func (*MockPostStore) EXPECT ¶
func (m *MockPostStore) EXPECT() *MockPostStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockPostStoreMockRecorder ¶
type MockPostStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockPostStoreMockRecorder is the mock recorder for MockPostStore.
func (*MockPostStoreMockRecorder) Create ¶
func (mr *MockPostStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockPostStoreMockRecorder) Delete ¶
func (mr *MockPostStoreMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockPostStoreMockRecorder) Get ¶
func (mr *MockPostStoreMockRecorder) Get(arg0, arg1, arg2 interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockPostStoreMockRecorder) List ¶
func (mr *MockPostStoreMockRecorder) List(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockPostStoreMockRecorder) Update ¶
func (mr *MockPostStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
Update indicates an expected call of Update.
type MockUserStore ¶
type MockUserStore struct {
// contains filtered or unexported fields
}
MockUserStore is a mock of UserStore interface.
func NewMockUserStore ¶
func NewMockUserStore(ctrl *gomock.Controller) *MockUserStore
NewMockUserStore creates a new mock instance.
func (*MockUserStore) Delete ¶
func (m *MockUserStore) Delete(arg0 context.Context, arg1 string) error
Delete mocks base method.
func (*MockUserStore) EXPECT ¶
func (m *MockUserStore) EXPECT() *MockUserStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockUserStoreMockRecorder ¶
type MockUserStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockUserStoreMockRecorder is the mock recorder for MockUserStore.
func (*MockUserStoreMockRecorder) Create ¶
func (mr *MockUserStoreMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockUserStoreMockRecorder) Delete ¶
func (mr *MockUserStoreMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockUserStoreMockRecorder) Get ¶
func (mr *MockUserStoreMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockUserStoreMockRecorder) List ¶
func (mr *MockUserStoreMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call
List indicates an expected call of List.
func (*MockUserStoreMockRecorder) Update ¶
func (mr *MockUserStoreMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
Update indicates an expected call of Update.
type PostStore ¶
type PostStore interface { Create(ctx context.Context, user *model.PostM) error Get(ctx context.Context, username string, postID string) (*model.PostM, error) Update(ctx context.Context, user *model.PostM) error List(ctx context.Context, username string, offset, limit int) (int64, []*model.PostM, error) Delete(ctx context.Context, username string, postIDs []string) error }
PostStore defines the methods that need to be implemented by the post model in the store layer
type UserStore ¶
type UserStore interface { Create(ctx context.Context, user *model.UserM) error Get(ctx context.Context, username string) (*model.UserM, error) Update(ctx context.Context, user *model.UserM) error List(ctx context.Context, offset, limit int) (int64, []*model.UserM, error) Delete(ctx context.Context, username string) error }
UserStore defines the methods that need to be implemented by the user model in the store layer