service

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL