server

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

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

Go to latest
Published: Dec 25, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(ctx context.Context, jwtSecretKey string, userID string) (string, time.Time, error)

func New

func New(ctx context.Context, jwtKey, ip string, port uint64, router []*Router, logger *logger.Logger,
	isTest bool) (*http.Server,
	error)

Types

type Claims

type Claims struct {
	UserID string `json:"user_id"`
	jwt.StandardClaims
}

type MiddleFunc

type MiddleFunc func(ctx context.Context, r RawRequest) (interface{}, error)

type RawRequest

type RawRequest struct {
	Req    []byte
	Params map[string][]string
	Header map[string][]string
	structs.Query
}

type Router

type Router struct {
	Path   string
	Method string
	FN     MiddleFunc

	IsNeedAuthenticate bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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