Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(r *routing.RouteGroup, service Service, logger log.Logger)
RegisterHandlers sets up the routing of the HTTP handlers.
Types ¶
type Account ¶
type Account struct {
entity.AccountResponse
}
Account represents the data about an account.
type Repository ¶
type Repository interface { // Get returns the album with the specified album ID. Get(ctx context.Context, id string) (entity.AccountResponse, error) // Count returns the number of albums. Count(ctx context.Context) (int, error) // Query returns the list of albums with the given offset and limit. Query(ctx context.Context, offset, limit int) ([]entity.AccountResponse, error) // Create saves a new album in the storage. Create(ctx context.Context, album entity.AccountRequest) error }
Repository encapsulates the logic to access albums from the data source.
func NewRepository ¶
func NewRepository(db *dbcontext.DB, logger log.Logger) Repository
NewRepository creates a new album repository
type Service ¶
type Service interface { Get(ctx context.Context, id string) (Account, error) Query(ctx context.Context, offset, limit int) ([]Account, error) Count(ctx context.Context) (int, error) Create(ctx context.Context, input entity.AccountRequest) (Account, error) }
Service encapsulates usecase logic for accounts.
func NewService ¶
func NewService(repo Repository, logger log.Logger) Service
NewService creates a new account service.
Click to show internal directories.
Click to hide internal directories.