mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Update comments across the codebase
This commit is contained in:
@@ -47,6 +47,7 @@ type EncoderParams struct {
|
||||
Technique EncoderTechnique
|
||||
}
|
||||
|
||||
// populate new header
|
||||
func NewHeader(key string, part uint8, metadata Metadata, encoderParams EncoderParams) DataHeader {
|
||||
header := DataHeader{}
|
||||
header.Key = key
|
||||
@@ -61,6 +62,7 @@ func NewHeader(key string, part uint8, metadata Metadata, encoderParams EncoderP
|
||||
return header
|
||||
}
|
||||
|
||||
// validate populated header
|
||||
func ValidateHeader(header DataHeader) bool {
|
||||
if header.Key == "" || header.Part < 0 || len(header.Metadata) < 2 {
|
||||
return false
|
||||
@@ -73,6 +75,7 @@ func ValidateHeader(header DataHeader) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Write data, returns error upon any failure
|
||||
func WriteData(target io.Writer, header DataHeader, data io.Reader) error {
|
||||
if !ValidateHeader(header) {
|
||||
return fmt.Errorf("Invalid header")
|
||||
|
||||
@@ -73,6 +73,7 @@ type DonutFrameFooter struct {
|
||||
|
||||
type Data bytes.Buffer
|
||||
|
||||
// Write Donut format to input io.Writer, returns error upon any failure
|
||||
func WriteFrame(target io.Writer, reader io.Reader, length uint64) error {
|
||||
// write header
|
||||
header := DonutFrameHeader{
|
||||
|
||||
Reference in New Issue
Block a user