Documentation ¶
Index ¶
Constants ¶
View Source
const MaxLIstLimit = 1000
MaxLIstLimit const
View Source
const TableName = "user"
TableName const
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IRepository ¶
type IRepository interface { // Get returns the album with the specified album ID. Get(ctx context.Context, id uint) (*User, error) // Count returns the number of albums. //Count(ctx context.Context) (uint, error) // Query returns the list of albums with the given offset and limit. Query(ctx context.Context, offset, limit uint) ([]User, error) SetDefaultConditions(conditions map[string]interface{}) // Create saves a new album in the storage. Create(ctx context.Context, entity *User) error // Update updates the album with given ID in the storage. //Update(ctx context.Context, entity *User) error // Delete removes the album with given ID from the storage. //Delete(ctx context.Context, id uint) error First(ctx context.Context, user *User) (*User, error) }
IRepository encapsulates the logic to access albums from the data source.
type IService ¶
type IService interface { NewEntity() *User Get(ctx context.Context, id uint) (*User, error) Query(ctx context.Context, offset, limit uint) ([]User, error) List(ctx context.Context) ([]User, error) //Count(ctx context.Context) (uint, error) Create(ctx context.Context, entity *User) error //Update(ctx context.Context, id string, input *User) (*User, error) //Delete(ctx context.Context, id string) (error) First(ctx context.Context, user *User) (*User, error) }
IService encapsulates usecase logic for user.
func NewService ¶
func NewService(repo IRepository, logger log.ILogger) IService
NewService creates a new service.
Click to show internal directories.
Click to hide internal directories.