snappy

package module
v0.0.0-...-fb68e53 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Snappy compression for Go HTTP clients and servers

Documentation license Go Report Card CircleCI

Add snappy stream compression to Go HTTP clients and Servers.

Example

Client
import (
    "net/http"

    "github.com/bakins/snappy"
)

func main() {
    client := &http.Client{
        Transport: snappy.Transport(),
    }

    // use client as normal
}
Server
import (
    "net/http"

    "github.com/bakins/snappy"
)

func main() {

    server := http.Server{
        Handler: snappy.Handler(http.DefaultServeMux)
    }
    // use server as normal
}

Documentation

Overview

Package snappy ienables snappy compression/decompression for HTTP clients and servers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(next http.Handler) http.Handler

Handler wraps an http handler with snappy compression.

func Transport

func Transport(base http.RoundTripper) http.RoundTripper

Transport wraps an http transport to add support for client side Snappy compression. if base is nil, http.DefaultTransport is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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