github.com/minio/madmin-go/v3@v3.0.51/estream/types.go (about)

     1  //
     2  // Copyright (c) 2015-2022 MinIO, Inc.
     3  //
     4  // This file is part of MinIO Object Storage stack
     5  //
     6  // This program is free software: you can redistribute it and/or modify
     7  // it under the terms of the GNU Affero General Public License as
     8  // published by the Free Software Foundation, either version 3 of the
     9  // License, or (at your option) any later version.
    10  //
    11  // This program is distributed in the hope that it will be useful,
    12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  // GNU Affero General Public License for more details.
    15  //
    16  // You should have received a copy of the GNU Affero General Public License
    17  // along with this program. If not, see <http://www.gnu.org/licenses/>.
    18  //
    19  
    20  package estream
    21  
    22  //go:generate stringer -type=blockID -trimprefix=block
    23  
    24  type blockID int8
    25  
    26  const (
    27  	blockPlainKey blockID = iota + 1
    28  	blockEncryptedKey
    29  	blockEncStream
    30  	blockPlainStream
    31  	blockDatablock
    32  	blockEOS
    33  	blockEOF
    34  	blockError
    35  )
    36  
    37  type checksumType uint8
    38  
    39  //go:generate stringer -type=checksumType -trimprefix=checksumType
    40  
    41  const (
    42  	checksumTypeNone checksumType = iota
    43  	checksumTypeXxhash
    44  
    45  	checksumTypeUnknown
    46  )
    47  
    48  func (c checksumType) valid() bool {
    49  	return c >= checksumTypeNone && c < checksumTypeUnknown
    50  }