mime

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Overview

Package mime does mime stuff

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Skipper:            middleware.DefaultSkipper,
	MimeTypesFile:      "",
	DefaultContentType: "application/data",
}

DefaultConfig is the default Gzip middleware config.

Functions

func New

func New() echo.MiddlewareFunc

New creates a new middleware function with the default config

func NewWithConfig

func NewWithConfig(config Config) echo.MiddlewareFunc

NewWithConfig creates a new middleware function with the provided config

Types

type Config

type Config struct {
	// Enabled indicates if the mime middleware should be enabled
	Enabled bool `json:"enabled" koanf:"enabled" default:"true"`
	// Skipper defines a function to skip middleware
	Skipper middleware.Skipper `json:"-" koanf:"-"`
	// MimeTypesFile is the file to load mime types from
	MimeTypesFile string `json:"mimeTypesFile" koanf:"mimeTypesFile" default:""`
	// DefaultContentType is the default content type to set if no mime type is found
	DefaultContentType string `json:"defaultContentType" koanf:"defaultContentType" default:"application/data"`
}

Config defines the config for Mime middleware

Jump to

Keyboard shortcuts

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