api

package
v0.0.0-...-7518d33 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiListenHttp

func ApiListenHttp()

ApiListenHttp starts the HTTP server

func ApiListenHttps

func ApiListenHttps()

func GenToken

func GenToken(userID int64) (string, error)

Types

type ErrorCodeFor422

type ErrorCodeFor422 string
const (
	MissingField  ErrorCodeFor422 = "missing_field"
	Invalid       ErrorCodeFor422 = "invalid"
	AlreadyExists ErrorCodeFor422 = "already_exists"
)

type ErrorFor422

type ErrorFor422 struct {
	Code   ErrorCodeFor422 `json:"code"`
	Field  string          `json:"field"`
	Detail string          `json:"detail"`
}

type MyClaims

type MyClaims struct {
	UserID int64 `json:"user_id"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(tokenString string) (*MyClaims, error)

ParseToken 解析JWT

Jump to

Keyboard shortcuts

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