Documentation
¶
Index ¶
- type AuthorService
- func (s *AuthorService) Create(ctx context.Context, name string, bio string) (repository.Author, error)
- func (s *AuthorService) Delete(ctx context.Context, authorID int64) error
- func (s *AuthorService) Get(ctx context.Context, authorID int64) (*repository.Author, error)
- func (s *AuthorService) List(ctx context.Context) ([]repository.Author, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorService ¶
type AuthorService struct {
// contains filtered or unexported fields
}
AuthorService is the Authors Service Layer
func NewService ¶
func NewService(queries repository.Querier) *AuthorService
NewService creates a new authors service
func (*AuthorService) Create ¶
func (s *AuthorService) Create(ctx context.Context, name string, bio string) (repository.Author, error)
Create creates a new author
func (*AuthorService) Delete ¶
func (s *AuthorService) Delete(ctx context.Context, authorID int64) error
Delete deletes an author by id
func (*AuthorService) Get ¶
func (s *AuthorService) Get(ctx context.Context, authorID int64) (*repository.Author, error)
Get returns an author by id
func (*AuthorService) List ¶
func (s *AuthorService) List(ctx context.Context) ([]repository.Author, error)
List returns all authors
Click to show internal directories.
Click to hide internal directories.