routes

package
v0.0.0-...-c1094a9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(ip string, port string)

func LoginRequired

func LoginRequired(ignore ...string) negroni.HandlerFunc

func SendJsonPost

func SendJsonPost(jsonBytes []byte, url string) ([]byte, error)

func Server

func Server()

func SetCurrentUser

func SetCurrentUser(r *http.Request, u *User)

Types

type CreateResult

type CreateResult struct {
	Message string `json:"message"`
	Status  bool   `json:"status"`
}

type File

type File struct {
	Dir  bool
	Name string
	Path string
	Date time.Time
}

type FileFindStruct

type FileFindStruct struct {
	Name  string   `json:"name" bson:"name"`
	Guest []string `json:"guest" bson:"guest"`
}

type FileInfos

type FileInfos struct {
	Files    []File
	PathName string
}

type FileStruct

type FileStruct struct {
	Name  string   `json:"name" bson:"name"`
	User  string   `json:"user" bson:"user"`
	Guest []string `json:"guest" bson:"guest"`
}

type JsonUser

type JsonUser struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResult

type LoginResult struct {
	Account User   `json:"account"`
	Message string `json:"message"`
	Status  bool   `json:"status"`
}

type User

type User struct {
	Uid      string    `json:"uid" bson:"uid"`
	Name     string    `json:"name" bson:"name"`
	Email    string    `json:"email" bson:"email"`
	AvataUrl string    `json:"avatarurl" bson:"avataurl"`
	Password string    `json:"password" bson:"password"`
	Token    string    `json:"token" bson:"token"`
	Expired  time.Time `json:"expired" bson:"expired"`
}

func GetCurrentUser

func GetCurrentUser(r *http.Request) *User

func (*User) Refresh

func (u *User) Refresh()

func (*User) Valid

func (u *User) Valid() bool

Jump to

Keyboard shortcuts

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