backend

package
v0.0.0-...-3d55026 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: BSL-1.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FRONTEND string = "http://localhost:5173"

Functions

func Route

func Route() *mux.Router

func SetDatabase

func SetDatabase(db2 *mongo.Database)

Types

type Event

type Event struct {
	Eventtype string             `json:"eventtype" bson:"eventtype"`
	Time      time.Time          `json:"time" bson:"time"`
	Params    EventParams        `json:"params" bson:"params"`
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
}

type EventParams

type EventParams = map[string]interface{}

type FlashMessage

type FlashMessage struct {
	Status  int8   `json:"status" bson:"status"`
	Message string `json:"message" bson:"message"`
}

type LatestEventsForm

type LatestEventsForm struct {
	Number int `json:"number"`
}

type LoginForm

type LoginForm struct {
	Email    string `schema:"email,required"`
	Password string `schema:"password,required"` // default:21 ; default ama|st
}

type Session

type Session struct {
	Userid    string                 `json:"userid" bson:"userid"`
	Sessionid string                 `json:"sessionid" bson:"sessionid"`
	Time      time.Time              `json:"time" bson:"time"`
	Data      map[string]interface{} `json:"data" bson:"data"`
	Flashes   []FlashMessage         `json:"flashes" bson:"flashes"`
	ID        primitive.ObjectID     `json:"id" bson:"_id"`
}

type SessionResponse

type SessionResponse struct {
	Session Session `json:"session"`
	User    User    `json:"user"`
	// contains filtered or unexported fields
}

type User

type User struct {
	Name     string             `json:"name" bson:"name"`
	Username string             `json:"username" bson:"username"`
	Role     string             `json:"role" bson:"role"`
	Contact  UserContact        `json:"contact" bson:"contact"`
	Tags     []string           `json:"tags" bson:"tags"`
	Bio      string             `json:"bio" bson:"bio"`
	Security UserSecurity       `json:"security" bson:"security"`
	Socials  []string           `json:"socials" bson:"socials"`
	ID       primitive.ObjectID `json:"id" bson:"_id"`
}

type UserContact

type UserContact struct {
	Email  string `json:"email" bson:"email"`
	Number int    `json:"number" bson:"number"`
}

type UserResponse

type UserResponse struct {
	User User `json:"user"`
	// contains filtered or unexported fields
}

type UserSecurity

type UserSecurity struct {
	Password string `json:"password" bson:"password"`
	Totp     string `json:"totp" bson:"totp"`
}

Jump to

Keyboard shortcuts

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