github.com/MetalBlockchain/metalgo@v1.11.9/utils/compression/no_compressor.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package compression
     5  
     6  var _ Compressor = (*noCompressor)(nil)
     7  
     8  type noCompressor struct{}
     9  
    10  func (*noCompressor) Compress(msg []byte) ([]byte, error) {
    11  	return msg, nil
    12  }
    13  
    14  func (*noCompressor) Decompress(msg []byte) ([]byte, error) {
    15  	return msg, nil
    16  }
    17  
    18  func NewNoCompressor() Compressor {
    19  	return &noCompressor{}
    20  }