repository

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	AddAuthor(author data.Author) (string, error)
	ListAll() []data.Author
	UpdateAuthor(author data.Author) (data.Author, error)
	DeleteAuthor(id string) error
	GetAuthor(id string) (data.Author, error)
	AuthorExist(id string) bool
}

func NewMongoDatabase

func NewMongoDatabase(mongoURI string, database string) Database

type Repository

type Repository interface {
	AddAuthor(author data.Author) (string, error)
	ListAll() []data.Author
	UpdateAuthor(author data.Author) (data.Author, error)
	DeleteAuthor(id string) error
	GetAuthor(id string) (data.Author, error)
	AuthorExist(id string) bool
}

Repository represents the repository interface.

func New

func New(db Database) Repository

New creates a new repository.

Jump to

Keyboard shortcuts

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