middleware

package
v0.0.0-...-9b663ca Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth() func(http.Handler) http.Handler

Auth ..

func CheckToken

func CheckToken(accessToken string) bool

CheckToken ..

func ForContext

func ForContext(ctx context.Context) *models.User

ForContext ..

func ForSchemeContext

func ForSchemeContext(ctx context.Context) string

ForSchemeContext ..

func HandleCard

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

HandleCard get public user info

func HandleIotDevice

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

HandleIotDevice ..

Types

type Error

type Error struct {
	Message string   `json:"message"`
	Path    []string `json:"path"`
}

Error ...

type ErrorResponse

type ErrorResponse struct {
	Errors []*Error `json:"errors"`
}

ErrorResponse ..

func NewErrorResponse

func NewErrorResponse(message, path string) *ErrorResponse

NewErrorResponse ..

type GraphReq

type GraphReq struct {
	OperationName string `json:"operationName"`
}

GraphReq ..

type User

type User struct {
	UID    int64  `json:"uid"`
	Avatar string `json:"avatar"`
	Name   string `json:"name"`
	Gender int    `json:"gender"`
}

User public user info

Jump to

Keyboard shortcuts

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