util

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const PEM_BEGIN = "-----BEGIN PUBLIC KEY-----"
View Source
const PEM_END = "-----END PUBLIC KEY-----"

Variables

This section is empty.

Functions

This section is empty.

Types

type CorsMiddleware

type CorsMiddleware struct {
	// contains filtered or unexported fields
}

func NewCors

func NewCors(handler http.Handler) *CorsMiddleware

func (*CorsMiddleware) ServeHTTP

func (this *CorsMiddleware) ServeHTTP(res http.ResponseWriter, req *http.Request)

type Jwt

type Jwt struct {
	// contains filtered or unexported fields
}

func NewJwt

func NewJwt(config configuration.Config) Jwt

func (Jwt) Parse

func (this Jwt) Parse(token string) (username string, user string, roles []string, clientId string, err error)

func (Jwt) ParseHeader

func (this Jwt) ParseHeader(header string) (username string, user string, roles []string, clientId string, err error)

func (Jwt) ParseRequest

func (this Jwt) ParseRequest(request *http.Request) (username string, user string, roles []string, clientId string, err error)

func (Jwt) ParseToken

func (this Jwt) ParseToken(token string) (username string, user string, roles []string, clientId string, err error)

type LoggerMiddleWare

type LoggerMiddleWare struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(handler http.Handler) *LoggerMiddleWare

func (*LoggerMiddleWare) ServeHTTP

func (this *LoggerMiddleWare) ServeHTTP(w http.ResponseWriter, request *http.Request)

type ResponseWriterWithStatusCodeLog

type ResponseWriterWithStatusCodeLog struct {
	Parent http.ResponseWriter
	Status int
}

func (*ResponseWriterWithStatusCodeLog) Header

func (*ResponseWriterWithStatusCodeLog) Write

func (this *ResponseWriterWithStatusCodeLog) Write(payload []byte) (int, error)

func (*ResponseWriterWithStatusCodeLog) WriteHeader

func (this *ResponseWriterWithStatusCodeLog) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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