lister

package
v0.0.0-...-7f3334f Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 1 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     string `bson:"_id" json:"_id" binding:"required"`
	Author User   `bson:"author" json:"author"`
	Image  string `bson:"image" json:"image"  binding:"required"`
	Text   string `bson:"text" json:"text" binding:"required"`
}

type Repository

type Repository interface {
	GetUser(string) (interface{}, error)
	GetPost(Post) (Post, error)
}

type Service

type Service interface {
	GetUser(string) (interface{}, error)
	GetPost(Post) (Post, error)
}

func NewService

func NewService(r Repository) Service

type User

type User struct {
	Id        string `bson:"_id" json:"_id"  binding:"required"`
	FirstName string `bson:"firstName" json:"firstName"  binding:"required"`
	LastName  string `bson:"lastName" json:"lastName"  binding:"required"`
	Email     string `bson:"email" json:"email"  binding:"required"`
}

Jump to

Keyboard shortcuts

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