Skip to content

About

Vetis content compression hooks

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

vetis-encode

Crates.io downloads crates.io Build Status Crates.io MSRV Documentation MIT licensed codecov

vetis-encode adds diffent compression methods to your host, choose the most appropriate one for your usecase!

Features

  • basic

Installation

Add this to your Cargo.toml:

[dependencies]
vetis-encode = { version = "0.1.0", features = "gzip" }

Configuration

Below you can find instruction on how to configure many auth options availble on vetis.

Using API

use vetis_encode::HookConfig as EncodeHookConfig;

let config = EncodeHookConfig::builder()
    .build()?;

vetis.yaml

- name: "encode"
  matcher:
    type: "path"
    paths:
      - "/protected*"
  formats:
    - format: "gzip"
      level: "best"
  minimum_size: 1024

Configuration Options

  • matcher: If set, this hook will be only called if request meet the criteria defined by him, otherwise, all requests will call this hook (optional)
  • formats: Allow provide a list of encoding formats and their compression levels, currently gzip, brotli, deflated and zstd are supported
  • minimum_size: A minimum content size to be compressed, specified in bytes

Runtime Features

Choose the appropriate runtime feature for your project:

  • runtime-tokio (default): Use with Tokio runtime
  • gzip: Enable gzip compression support
  • brotli: Enable brotli compression support
  • deflate: Enable deflate compression support
  • zstd: Enable zstd compression support

License

Licensed under either of

at your option.

Author

Rogerio Pereira Araujo [email protected]

About

Vetis content compression hooks

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages