listing

package
v0.0.0-...-88b2b22 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	ID       uint   `json:"id"`
	AuthorID uint   `json:"author_id"`
	Content  string `json:"content"`
}

Post defines the properties of a Post to be listed

type Repository

type Repository interface {
	// GetAllPosts returns all Posts saved in storage.
	GetAllPosts() ([]Post, error)
}

Repository provides access to Post repository.

type Service

type Service interface {
	GetAllPosts() ([]Post, error)
}

Service provides Post listing operations.

func NewService

func NewService(r Repository) Service

NewService creates an list service with the necessary dependencies

Jump to

Keyboard shortcuts

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