rating

package
v0.0.0-...-dd01cb3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Svc service
}

func NewHandler

func NewHandler(svc service) *Handler

func (*Handler) Create

func (h *Handler) Create(w http.ResponseWriter, r *http.Request)

func (*Handler) Routes

func (h *Handler) Routes() []router.Route

type MongoDBRepository

type MongoDBRepository struct {
	// contains filtered or unexported fields
}

func NewMongoDBRepo

func NewMongoDBRepo(session *mgo.Session) *MongoDBRepository

func (*MongoDBRepository) Upsert

func (r *MongoDBRepository) Upsert(ctx context.Context, rating *types.Rating) (bool, error)

Upsert update and insert :\

type RepoProvider

type RepoProvider interface {
	Upsert(ctx context.Context, rating *types.Rating) (bool, error)
}

type Service

type Service struct {
	Repo RepoProvider
}

func NewService

func NewService(repo RepoProvider) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, rating *types.Rating) error

Jump to

Keyboard shortcuts

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