chore: cleanup unused constants

We have some leftover constants from some previous changes. This
just cleans up all that are no longer needed.
This commit is contained in:
Ben McClelland
2025-10-09 12:19:00 -07:00
parent 874165cdcf
commit 40da4a31d3
5 changed files with 4 additions and 8 deletions

View File

@@ -94,9 +94,7 @@ const (
const ( const (
// ScoutFS special xattr types // ScoutFS special xattr types
systemPrefix = "scoutfs.hide." systemPrefix = "scoutfs.hide."
onameAttr = systemPrefix + "objname"
flagskey = systemPrefix + "sam_flags" flagskey = systemPrefix + "sam_flags"
stagecopykey = systemPrefix + "sam_stagereq"
) )
const ( const (

View File

@@ -41,7 +41,6 @@ type S3ApiController struct {
const ( const (
// time constants // time constants
iso8601Format = "20060102T150405Z"
iso8601TimeFormatExtended = "Mon Jan _2 15:04:05 2006" iso8601TimeFormatExtended = "Mon Jan _2 15:04:05 2006"
timefmt = "Mon, 02 Jan 2006 15:04:05 GMT" timefmt = "Mon, 02 Jan 2006 15:04:05 GMT"

View File

@@ -174,7 +174,7 @@ func NewChunkReader(ctx *fiber.Ctx, r io.Reader, authdata AuthData, region, secr
} }
if decContLength > maxObjSizeLimit { if decContLength > maxObjSizeLimit {
debuglogger.Logf("the object size exceeds the allowed limit: (size): %v, (limit): %v", decContLength, maxObjSizeLimit) debuglogger.Logf("the object size exceeds the allowed limit: (size): %v, (limit): %v", decContLength, int64(maxObjSizeLimit))
return nil, s3err.GetAPIError(s3err.ErrEntityTooLarge) return nil, s3err.GetAPIError(s3err.ErrEntityTooLarge)
} }

View File

@@ -39,7 +39,6 @@ import (
// https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html // https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
const ( const (
chunkHdrDelim = "\r\n"
zeroLenSig = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" zeroLenSig = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
awsV4 = "AWS4" awsV4 = "AWS4"
awsS3Service = "s3" awsS3Service = "s3"

View File

@@ -29,7 +29,7 @@ import (
) )
const ( const (
logFileMode = 0600 logFileMode = 0644
timeFormat = "02/January/2006:15:04:05 -0700" timeFormat = "02/January/2006:15:04:05 -0700"
) )
@@ -45,12 +45,12 @@ var _ AuditLogger = &FileLogger{}
// InitFileLogger initializes audit logs to local file // InitFileLogger initializes audit logs to local file
func InitFileLogger(logname string) (AuditLogger, error) { func InitFileLogger(logname string) (AuditLogger, error) {
f, err := os.OpenFile(logname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) f, err := os.OpenFile(logname, os.O_APPEND|os.O_CREATE|os.O_WRONLY, logFileMode)
if err != nil { if err != nil {
return nil, fmt.Errorf("open log: %w", err) return nil, fmt.Errorf("open log: %w", err)
} }
f.WriteString(fmt.Sprintf("log starts %v\n", time.Now())) fmt.Fprintf(f, "log starts %v\n", time.Now())
return &FileLogger{logfile: logname, f: f}, nil return &FileLogger{logfile: logname, f: f}, nil
} }