routes

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ApiDocPath = "/api/docs"
View Source
const HelthPath = "/health"

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiDoc

type ApiDoc struct {
	Debug bool
}

func (*ApiDoc) Handle

func (a *ApiDoc) Handle(w http.ResponseWriter, r *http.Request, _ map[string]string)

func (*ApiDoc) Method

func (a *ApiDoc) Method() string

func (*ApiDoc) Middlewares

func (a *ApiDoc) Middlewares() []middlewares.Middleware

func (*ApiDoc) Path

func (a *ApiDoc) Path() string

func (*ApiDoc) SetClient

func (a *ApiDoc) SetClient(client *grpc.ClientConn)

type ApiDocRedirect

type ApiDocRedirect struct {
}

func (*ApiDocRedirect) Handle

func (a *ApiDocRedirect) Handle(w http.ResponseWriter, r *http.Request, _ map[string]string)

func (*ApiDocRedirect) Method

func (a *ApiDocRedirect) Method() string

func (*ApiDocRedirect) Middlewares

func (a *ApiDocRedirect) Middlewares() []middlewares.Middleware

func (*ApiDocRedirect) Path

func (a *ApiDocRedirect) Path() string

func (*ApiDocRedirect) SetClient

func (a *ApiDocRedirect) SetClient(client *grpc.ClientConn)

type FindUserByUsernameAndPassword

type FindUserByUsernameAndPassword func(username string, password string) jwt.MapClaims

type Health

type Health struct {
}

func (*Health) Handle

func (h *Health) Handle(w http.ResponseWriter, r *http.Request, _ map[string]string)

func (*Health) Method

func (h *Health) Method() string

func (*Health) Middlewares

func (h *Health) Middlewares() []middlewares.Middleware

func (*Health) Path

func (h *Health) Path() string

func (*Health) SetClient

func (h *Health) SetClient(client *grpc.ClientConn)

type JwtLogin

type JwtLogin struct {
	PathUrl       string
	UserField     string
	PasswordField string
	Secret        string
	SigningMethod string
	Expire        int
	RefreshToken  bool
	FindUser      FindUserByUsernameAndPassword
}

func DefaultJwtLogin

func DefaultJwtLogin(path string, secret string, signingMethod string, refreshToken bool, findUser FindUserByUsernameAndPassword) *JwtLogin

func NewJwtLogin

func NewJwtLogin(
	path string,
	userField string,
	passwordField string,
	secret string,
	signingMethod string,
	expire int,
	refreshToken bool,
	findUser FindUserByUsernameAndPassword,
) *JwtLogin

func (*JwtLogin) Handle

func (j *JwtLogin) Handle(w http.ResponseWriter, r *http.Request, _ map[string]string)

func (*JwtLogin) Method

func (j *JwtLogin) Method() string

func (*JwtLogin) Middlewares

func (j *JwtLogin) Middlewares() []middlewares.Middleware

func (*JwtLogin) Path

func (j *JwtLogin) Path() string

func (*JwtLogin) SetClient

func (j *JwtLogin) SetClient(client *grpc.ClientConn)

type JwtRefresh

type JwtRefresh struct {
	PathUrl       string
	Secret        string
	SigningMethod string
	Expire        int
}

func (*JwtRefresh) Handle

func (j *JwtRefresh) Handle(w http.ResponseWriter, r *http.Request, _ map[string]string)

func (*JwtRefresh) Method

func (j *JwtRefresh) Method() string

func (*JwtRefresh) Middlewares

func (j *JwtRefresh) Middlewares() []middlewares.Middleware

func (*JwtRefresh) Path

func (j *JwtRefresh) Path() string

func (*JwtRefresh) SetClient

func (j *JwtRefresh) SetClient(client *grpc.ClientConn)

type Route

type Route interface {
	Path() string
	Method() string
	Handle(w http.ResponseWriter, r *http.Request, params map[string]string)
	SetClient(client *grpc.ClientConn)
	Middlewares() []middlewares.Middleware
}

Jump to

Keyboard shortcuts

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