services

package
v0.0.0-...-4c696b6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Collection *mongo.Collection
}

func (*Service) Create

func (s *Service) Create(model interface{}) func(w http.ResponseWriter, r *http.Request)

Create an item

func (*Service) Delete

func (s *Service) Delete(w http.ResponseWriter, r *http.Request)

Delete an item by id

func (*Service) Find

func (s *Service) Find(model interface{}) func(w http.ResponseWriter, r *http.Request)

Find all items

func (*Service) FindOne

func (s *Service) FindOne(model interface{}) func(w http.ResponseWriter, r *http.Request)

FindOne item

type User

type User struct {
	Service
	ClientCollection *mongo.Collection
	Model            models.User
}

User handles all item related logic

func (*User) Create

func (s *User) Create(w http.ResponseWriter, r *http.Request)

func (*User) Login

func (s *User) Login(sessionInfo *session.Session) func(w http.ResponseWriter, r *http.Request)

Login authenticates users

Jump to

Keyboard shortcuts

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