restAPI

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

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MONGOURL = "mongodb://localhost:27017"
	DATABASE = "appointy"
)

Functions

func CreatePostsHandler

func CreatePostsHandler(w http.ResponseWriter, r *http.Request)

func CreateUsersHandler

func CreateUsersHandler(w http.ResponseWriter, r *http.Request)

func ErrorHandler

func ErrorHandler(w http.ResponseWriter, r *http.Request)

func GetPostsByUserHandler

func GetPostsByUserHandler(w http.ResponseWriter, r *http.Request)

func GetPostsHandler

func GetPostsHandler(w http.ResponseWriter, r *http.Request)

func GetUsersHandler

func GetUsersHandler(w http.ResponseWriter, r *http.Request)

func HomePageHandler

func HomePageHandler(w http.ResponseWriter, r *http.Request)

func InitMongoConnection

func InitMongoConnection()

Types

type Post

type Post struct {
	ID       primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	Caption  string             `json:"caption,omitempty" bson:"caption,omitempty"`
	ImageUrl string             `json:"imageUrl,omitempty" bson:"imageUrl,omitempty"`
	Time     string             `json:"time,omitempty" bson:"time,omitempty"`
	UserId   string             `json:"userId,omitempty" bson:"userId"`
}

type User

type User struct {
	ID       primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	Name     string             `json:"name,omitempty" bson:"name,omitempty"`
	Email    string             `json:"email,omitempty" bson:"email,omitempty"`
	Password string             `json:"password,omitempty" bson:"password,omit"`
}

Jump to

Keyboard shortcuts

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