rkechogzip

package
v1.2.18 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package rkechogzip is a middleware for echo framework which compress/decompress data for RPC

Index

Constants

View Source
const (

	// NoCompression copied from gzip.NoCompression
	NoCompression = "noCompression"
	// BestSpeed copied from gzip.BestSpeed
	BestSpeed = "bestSpeed"
	// BestCompression copied from gzip.BestCompression
	BestCompression = "bestCompression"
	// DefaultCompression copied from gzip.DefaultCompression
	DefaultCompression = "defaultCompression"
	// HuffmanOnly copied from gzip.HuffmanOnly
	HuffmanOnly = "huffmanOnly"
)

Variables

This section is empty.

Functions

func Middleware

func Middleware(opts ...Option) echo.MiddlewareFunc

Middleware Add gzip compress and decompress interceptors.

Mainly copied from bellow. https://github.com/labstack/echo/blob/master/middleware/decompress.go https://github.com/labstack/echo/blob/master/middleware/compress.go

Types

type Option

type Option func(*optionSet)

Option if for middleware options while creating middleware

func WithEntryNameAndType

func WithEntryNameAndType(entryName, entryType string) Option

WithEntryNameAndType provide entry name and entry type.

func WithLevel

func WithLevel(level string) Option

WithLevel provide level of compressing.

func WithPathToIgnore

func WithPathToIgnore(prefix ...string) Option

WithPathToIgnore provide path prefix to ignore middleware

func WithSkipper

func WithSkipper(skip Skipper) Option

WithSkipper provide skipper.

type Skipper

type Skipper func(echo.Context) bool

Skipper default skipper will always return false

Jump to

Keyboard shortcuts

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