MCPcopy
hub / github.com/kopia/kopia / RegisterCompressor

Function RegisterCompressor

repo/compression/compressor.go:39–51  ·  view source on GitHub ↗

RegisterCompressor registers the provided compressor implementation.

(name Name, c Compressor)

Source from the content-addressed store, hash-verified

37
38// RegisterCompressor registers the provided compressor implementation.
39func RegisterCompressor(name Name, c Compressor) {
40 if ByHeaderID[c.HeaderID()] != nil {
41 panic(fmt.Sprintf("compressor with HeaderID %x already registered", c.HeaderID()))
42 }
43
44 if ByName[name] != nil {
45 panic(fmt.Sprintf("compressor with name %q already registered", name))
46 }
47
48 ByHeaderID[c.HeaderID()] = c
49 ByName[name] = c
50 HeaderIDToName[c.HeaderID()] = name
51}
52
53// RegisterDeprecatedCompressor registers the provided compressor implementation.
54func RegisterDeprecatedCompressor(name Name, c Compressor) {

Callers 8

initFunction · 0.85
initFunction · 0.85
initFunction · 0.85
initFunction · 0.85
initFunction · 0.85

Calls 1

HeaderIDMethod · 0.65

Tested by 1