Documentation ¶
Index ¶
- Constants
- Variables
- func Append(dict1 []byte, dict2 []byte) []byte
- func BrotliCompress(provider DictionaryProvider, b []byte, id string, customVersion int, ...) ([]byte, error)
- func BrotliDecompress(provider DictionaryProvider, b []byte, id string, customVersion int, ...) ([]byte, error)
- func Combined(p DictionaryProvider, id string, customVersion int, sharedVersion int) ([]byte, error)
- func CustomDictionary(p DictionaryProvider, id string, version int) ([]byte, error)
- func SharedDictionary(p DictionaryProvider, version int) ([]byte, error)
- func ZlibCompress(provider DictionaryProvider, level int, b []byte, id string, customVersion int, ...) ([]byte, error)
- func ZlibDecompress(provider DictionaryProvider, b []byte, id string, customVersion int, ...) ([]byte, error)
- type DictionaryProvider
- type FileDictionaryProvider
- type MemoryDictionaryProvider
- func (p *MemoryDictionaryProvider) AddCustom(id string, version int, dict []byte) error
- func (p *MemoryDictionaryProvider) AddShared(version int, dict []byte) error
- func (p *MemoryDictionaryProvider) CustomDictionary(id string, version int) ([]byte, error)
- func (p *MemoryDictionaryProvider) SharedDictionary(version int) ([]byte, error)
- type URLDictionaryProvider
- type Version
Constants ¶
View Source
const DEFAULT_CACHE_SIZE = 512
View Source
const SHARED = "shared"
Variables ¶
View Source
var INVALID_HOSTS = map[string]bool{"shared": true}
Functions ¶
func BrotliCompress ¶
func BrotliCompress(provider DictionaryProvider, b []byte, id string, customVersion int, sharedVersion int) ([]byte, error)
Given a dictionary provider, compress some bytes with Brotli using versioned dictionaries. Use 0 to ignore that type of dictionary.
func BrotliDecompress ¶
func BrotliDecompress(provider DictionaryProvider, b []byte, id string, customVersion int, sharedVersion int) ([]byte, error)
Given a dictionary provider, decompress some bytes with Brotli using versioned dictionaries. Use 0 to ignore that type of dictionary.
func CustomDictionary ¶
func CustomDictionary(p DictionaryProvider, id string, version int) ([]byte, error)
func SharedDictionary ¶
func SharedDictionary(p DictionaryProvider, version int) ([]byte, error)
func ZlibCompress ¶
func ZlibCompress(provider DictionaryProvider, level int, b []byte, id string, customVersion int, sharedVersion int) ([]byte, error)
Given a dictionary provider, compress some bytes with zlib using versioned dictionaries. Use 0 to ignore that type of dictionary.
func ZlibDecompress ¶
func ZlibDecompress(provider DictionaryProvider, b []byte, id string, customVersion int, sharedVersion int) ([]byte, error)
Given a dictionary provider, decompress some bytes with zlib using versioned dictionaries. Use 0 to ignore that type of dictionary.
Types ¶
type DictionaryProvider ¶
type FileDictionaryProvider ¶
type FileDictionaryProvider struct { BaseCustomDirectory string }
func NewFileDictionaryProvider ¶
func NewFileDictionaryProvider(BaseSharedDirectory string, BaseCustomDirectory string) *FileDictionaryProvider
func (FileDictionaryProvider) CustomDictionary ¶
func (p FileDictionaryProvider) CustomDictionary(id string, version int) ([]byte, error)
func (FileDictionaryProvider) SharedDictionary ¶
func (p FileDictionaryProvider) SharedDictionary(version int) ([]byte, error)
type MemoryDictionaryProvider ¶
type MemoryDictionaryProvider struct { CustomDictionaries map[string]map[int][]byte // contains filtered or unexported fields }
func NewMemoryDictionaryProvider ¶
func NewMemoryDictionaryProvider() *MemoryDictionaryProvider
func (*MemoryDictionaryProvider) AddCustom ¶
func (p *MemoryDictionaryProvider) AddCustom(id string, version int, dict []byte) error
func (*MemoryDictionaryProvider) AddShared ¶
func (p *MemoryDictionaryProvider) AddShared(version int, dict []byte) error
func (*MemoryDictionaryProvider) CustomDictionary ¶
func (p *MemoryDictionaryProvider) CustomDictionary(id string, version int) ([]byte, error)
func (*MemoryDictionaryProvider) SharedDictionary ¶
func (p *MemoryDictionaryProvider) SharedDictionary(version int) ([]byte, error)
type URLDictionaryProvider ¶
type URLDictionaryProvider struct { BaseCustomURL string UseMemoryCache bool MemoryCacheSize int UseFSCache bool FSCustomPrefix string // contains filtered or unexported fields }
func NewCachedURLDictionaryProvider ¶
func NewCachedURLDictionaryProvider(BaseSharedURL string, BaseCustomURL string, UseMemoryCache bool, MemoryCacheSize int, UseFSCache bool, FSSharedPrefix string, FSCustomPrefix string) (*URLDictionaryProvider, error)
More complicated constructor with caching options
func NewURLDictionaryProvider ¶
func NewURLDictionaryProvider(BaseSharedURL string, BaseCustomURL string) *URLDictionaryProvider
Create a basic URL provider, all requests will go over HTTP
func (*URLDictionaryProvider) CustomDictionary ¶
func (p *URLDictionaryProvider) CustomDictionary(id string, version int) ([]byte, error)
func (*URLDictionaryProvider) SharedDictionary ¶
func (p *URLDictionaryProvider) SharedDictionary(version int) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.