story

package
v0.0.0-...-9c1cc18 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(app *fiber.App, collection *mongo.Collection, store *session.Store)

Handler is the handler for the story service.

Types

type Repository

type Repository interface {
	// Create creates a new story.
	Create(story models.Story) (models.Story, error)

	// Get gets a story by ID.
	Get(id string) (models.Story, error)

	// Delete deletes a story by ID.
	Update(id string, story models.Story) (models.Story, error)
}

func NewRepository

func NewRepository(collection *mongo.Collection) Repository

NewRepository creates a new story repository.

type Service

type Service interface {
	// Create creates a new story.
	Create(story models.Story) (models.Story, int, error)

	// Get gets a story by ID.
	Get(id string) (models.Story, int, error)

	// Update updates a story by ID.
	Update(id string, story models.Story) (models.Story, int, error)
}

func NewService

func NewService(repo Repository) Service

NewService creates a new story service.

Jump to

Keyboard shortcuts

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