adding

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicate = fmt.Errorf("Post already exist")

ErrDuplicate defines the error message

Functions

This section is empty.

Types

type Post

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

Post basic post struct

type Repository

type Repository interface {
	AddPost(Post) error
}

Repository provides access to Post repository.

type Service

type Service interface {
	AddPost(Post) error
}

Service provides Post adding operations.

func NewService

func NewService(r Repository) Service

NewService creates an adding service with the necessary dependencies

Jump to

Keyboard shortcuts

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