mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.85 to 7.0.89 (#3977)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.85 to 7.0.89. - [Release notes](https://github.com/minio/minio-go/releases) - [Commits](https://github.com/minio/minio-go/compare/v7.0.85...v7.0.89) --- updated-dependencies: - dependency-name: github.com/minio/minio-go/v7 dependency-version: 7.0.89 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
202
vendor/github.com/minio/crc64nvme/LICENSE
generated
vendored
Normal file
202
vendor/github.com/minio/crc64nvme/LICENSE
generated
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
20
vendor/github.com/minio/crc64nvme/README.md
generated
vendored
Normal file
20
vendor/github.com/minio/crc64nvme/README.md
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
## crc64nvme
|
||||
|
||||
This Golang package calculates CRC64 checksums using carryless-multiplication accelerated with SIMD instructions for both ARM and x86. It is based on the NVME polynomial as specified in the [NVM Express® NVM Command Set Specification](https://nvmexpress.org/wp-content/uploads/NVM-Express-NVM-Command-Set-Specification-1.0d-2023.12.28-Ratified.pdf).
|
||||
|
||||
The code is based on the [crc64fast-nvme](https://github.com/awesomized/crc64fast-nvme.git) package in Rust and is released under the Apache 2.0 license.
|
||||
|
||||
For more background on the exact technique used, see this [Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction](https://web.archive.org/web/20131224125630/https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf) paper.
|
||||
|
||||
### Performance
|
||||
|
||||
To follow.
|
||||
|
||||
### Requirements
|
||||
|
||||
All Go versions >= 1.22 are supported.
|
||||
|
||||
### Contributing
|
||||
|
||||
Contributions are welcome, please send PRs for any enhancements.
|
180
vendor/github.com/minio/crc64nvme/crc64.go
generated
vendored
Normal file
180
vendor/github.com/minio/crc64nvme/crc64.go
generated
vendored
Normal file
@ -0,0 +1,180 @@
|
||||
// Copyright (c) 2025 Minio Inc. All rights reserved.
|
||||
// Use of this source code is governed by a license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Package crc64nvme implements the 64-bit cyclic redundancy check with NVME polynomial.
|
||||
package crc64nvme
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"hash"
|
||||
"sync"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// The size of a CRC-64 checksum in bytes.
|
||||
Size = 8
|
||||
|
||||
// The NVME polynoimial (reversed, as used by Go)
|
||||
NVME = 0x9a6c9329ac4bc9b5
|
||||
)
|
||||
|
||||
var (
|
||||
// precalculated table.
|
||||
nvmeTable = makeTable(NVME)
|
||||
)
|
||||
|
||||
// table is a 256-word table representing the polynomial for efficient processing.
|
||||
type table [256]uint64
|
||||
|
||||
var (
|
||||
slicing8TablesBuildOnce sync.Once
|
||||
slicing8TableNVME *[8]table
|
||||
)
|
||||
|
||||
func buildSlicing8TablesOnce() {
|
||||
slicing8TablesBuildOnce.Do(buildSlicing8Tables)
|
||||
}
|
||||
|
||||
func buildSlicing8Tables() {
|
||||
slicing8TableNVME = makeSlicingBy8Table(makeTable(NVME))
|
||||
}
|
||||
|
||||
func makeTable(poly uint64) *table {
|
||||
t := new(table)
|
||||
for i := 0; i < 256; i++ {
|
||||
crc := uint64(i)
|
||||
for j := 0; j < 8; j++ {
|
||||
if crc&1 == 1 {
|
||||
crc = (crc >> 1) ^ poly
|
||||
} else {
|
||||
crc >>= 1
|
||||
}
|
||||
}
|
||||
t[i] = crc
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
func makeSlicingBy8Table(t *table) *[8]table {
|
||||
var helperTable [8]table
|
||||
helperTable[0] = *t
|
||||
for i := 0; i < 256; i++ {
|
||||
crc := t[i]
|
||||
for j := 1; j < 8; j++ {
|
||||
crc = t[crc&0xff] ^ (crc >> 8)
|
||||
helperTable[j][i] = crc
|
||||
}
|
||||
}
|
||||
return &helperTable
|
||||
}
|
||||
|
||||
// digest represents the partial evaluation of a checksum.
|
||||
type digest struct {
|
||||
crc uint64
|
||||
}
|
||||
|
||||
// New creates a new hash.Hash64 computing the CRC-64 checksum using the
|
||||
// NVME polynomial. Its Sum method will lay the
|
||||
// value out in big-endian byte order. The returned Hash64 also
|
||||
// implements [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to
|
||||
// marshal and unmarshal the internal state of the hash.
|
||||
func New() hash.Hash64 { return &digest{0} }
|
||||
|
||||
func (d *digest) Size() int { return Size }
|
||||
|
||||
func (d *digest) BlockSize() int { return 1 }
|
||||
|
||||
func (d *digest) Reset() { d.crc = 0 }
|
||||
|
||||
const (
|
||||
magic = "crc\x02"
|
||||
marshaledSize = len(magic) + 8 + 8
|
||||
)
|
||||
|
||||
func (d *digest) MarshalBinary() ([]byte, error) {
|
||||
b := make([]byte, 0, marshaledSize)
|
||||
b = append(b, magic...)
|
||||
b = binary.BigEndian.AppendUint64(b, tableSum)
|
||||
b = binary.BigEndian.AppendUint64(b, d.crc)
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func (d *digest) UnmarshalBinary(b []byte) error {
|
||||
if len(b) < len(magic) || string(b[:len(magic)]) != magic {
|
||||
return errors.New("hash/crc64: invalid hash state identifier")
|
||||
}
|
||||
if len(b) != marshaledSize {
|
||||
return errors.New("hash/crc64: invalid hash state size")
|
||||
}
|
||||
if tableSum != binary.BigEndian.Uint64(b[4:]) {
|
||||
return errors.New("hash/crc64: tables do not match")
|
||||
}
|
||||
d.crc = binary.BigEndian.Uint64(b[12:])
|
||||
return nil
|
||||
}
|
||||
|
||||
func update(crc uint64, p []byte) uint64 {
|
||||
if hasAsm && len(p) > 127 {
|
||||
ptr := unsafe.Pointer(&p[0])
|
||||
if align := (uintptr(ptr)+15)&^0xf - uintptr(ptr); align > 0 {
|
||||
// Align to 16-byte boundary.
|
||||
crc = update(crc, p[:align])
|
||||
p = p[align:]
|
||||
}
|
||||
runs := len(p) / 128
|
||||
crc = updateAsm(crc, p[:128*runs])
|
||||
return update(crc, p[128*runs:])
|
||||
}
|
||||
|
||||
buildSlicing8TablesOnce()
|
||||
crc = ^crc
|
||||
// table comparison is somewhat expensive, so avoid it for small sizes
|
||||
for len(p) >= 64 {
|
||||
var helperTable = slicing8TableNVME
|
||||
// Update using slicing-by-8
|
||||
for len(p) > 8 {
|
||||
crc ^= binary.LittleEndian.Uint64(p)
|
||||
crc = helperTable[7][crc&0xff] ^
|
||||
helperTable[6][(crc>>8)&0xff] ^
|
||||
helperTable[5][(crc>>16)&0xff] ^
|
||||
helperTable[4][(crc>>24)&0xff] ^
|
||||
helperTable[3][(crc>>32)&0xff] ^
|
||||
helperTable[2][(crc>>40)&0xff] ^
|
||||
helperTable[1][(crc>>48)&0xff] ^
|
||||
helperTable[0][crc>>56]
|
||||
p = p[8:]
|
||||
}
|
||||
}
|
||||
// For reminders or small sizes
|
||||
for _, v := range p {
|
||||
crc = nvmeTable[byte(crc)^v] ^ (crc >> 8)
|
||||
}
|
||||
return ^crc
|
||||
}
|
||||
|
||||
// Update returns the result of adding the bytes in p to the crc.
|
||||
func Update(crc uint64, p []byte) uint64 {
|
||||
return update(crc, p)
|
||||
}
|
||||
|
||||
func (d *digest) Write(p []byte) (n int, err error) {
|
||||
d.crc = update(d.crc, p)
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
func (d *digest) Sum64() uint64 { return d.crc }
|
||||
|
||||
func (d *digest) Sum(in []byte) []byte {
|
||||
s := d.Sum64()
|
||||
return append(in, byte(s>>56), byte(s>>48), byte(s>>40), byte(s>>32), byte(s>>24), byte(s>>16), byte(s>>8), byte(s))
|
||||
}
|
||||
|
||||
// Checksum returns the CRC-64 checksum of data
|
||||
// using the NVME polynomial.
|
||||
func Checksum(data []byte) uint64 { return update(0, data) }
|
||||
|
||||
// ISO tablesum of NVME poly
|
||||
const tableSum = 0x8ddd9ee4402c7163
|
15
vendor/github.com/minio/crc64nvme/crc64_amd64.go
generated
vendored
Normal file
15
vendor/github.com/minio/crc64nvme/crc64_amd64.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2025 Minio Inc. All rights reserved.
|
||||
// Use of this source code is governed by a license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
//go:build !noasm && !appengine && !gccgo
|
||||
|
||||
package crc64nvme
|
||||
|
||||
import (
|
||||
"github.com/klauspost/cpuid/v2"
|
||||
)
|
||||
|
||||
var hasAsm = cpuid.CPU.Supports(cpuid.SSE2, cpuid.CLMUL, cpuid.SSE4)
|
||||
|
||||
func updateAsm(crc uint64, p []byte) (checksum uint64)
|
157
vendor/github.com/minio/crc64nvme/crc64_amd64.s
generated
vendored
Normal file
157
vendor/github.com/minio/crc64nvme/crc64_amd64.s
generated
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
// Copyright (c) 2025 Minio Inc. All rights reserved.
|
||||
// Use of this source code is governed by a license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
//go:build !noasm && !appengine && !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
TEXT ·updateAsm(SB), $0-40
|
||||
MOVQ crc+0(FP), AX // checksum
|
||||
MOVQ p_base+8(FP), SI // start pointer
|
||||
MOVQ p_len+16(FP), CX // length of buffer
|
||||
NOTQ AX
|
||||
SHRQ $7, CX
|
||||
CMPQ CX, $1
|
||||
JLT skip128
|
||||
|
||||
VMOVDQA 0x00(SI), X0
|
||||
VMOVDQA 0x10(SI), X1
|
||||
VMOVDQA 0x20(SI), X2
|
||||
VMOVDQA 0x30(SI), X3
|
||||
VMOVDQA 0x40(SI), X4
|
||||
VMOVDQA 0x50(SI), X5
|
||||
VMOVDQA 0x60(SI), X6
|
||||
VMOVDQA 0x70(SI), X7
|
||||
MOVQ AX, X8
|
||||
PXOR X8, X0
|
||||
CMPQ CX, $1
|
||||
JE tail128
|
||||
|
||||
MOVQ $0xa1ca681e733f9c40, AX
|
||||
MOVQ AX, X8
|
||||
MOVQ $0x5f852fb61e8d92dc, AX
|
||||
PINSRQ $0x1, AX, X9
|
||||
|
||||
loop128:
|
||||
ADDQ $128, SI
|
||||
SUBQ $1, CX
|
||||
VMOVDQA X0, X10
|
||||
PCLMULQDQ $0x00, X8, X10
|
||||
PCLMULQDQ $0x11, X9, X0
|
||||
PXOR X10, X0
|
||||
PXOR 0(SI), X0
|
||||
VMOVDQA X1, X10
|
||||
PCLMULQDQ $0x00, X8, X10
|
||||
PCLMULQDQ $0x11, X9, X1
|
||||
PXOR X10, X1
|
||||
PXOR 0x10(SI), X1
|
||||
VMOVDQA X2, X10
|
||||
PCLMULQDQ $0x00, X8, X10
|
||||
PCLMULQDQ $0x11, X9, X2
|
||||
PXOR X10, X2
|
||||
PXOR 0x20(SI), X2
|
||||
VMOVDQA X3, X10
|
||||
PCLMULQDQ $0x00, X8, X10
|
||||
PCLMULQDQ $0x11, X9, X3
|
||||
PXOR X10, X3
|
||||
PXOR 0x30(SI), X3
|
||||
VMOVDQA X4, X10
|
||||
PCLMULQDQ $0x00, X8, X10
|
||||
PCLMULQDQ $0x11, X9, X4
|
||||
PXOR X10, X4
|
||||
PXOR 0x40(SI), X4
|
||||
VMOVDQA X5, X10
|
||||
PCLMULQDQ $0x00, X8, X10
|
||||
PCLMULQDQ $0x11, X9, X5
|
||||
PXOR X10, X5
|
||||
PXOR 0x50(SI), X5
|
||||
VMOVDQA X6, X10
|
||||
PCLMULQDQ $0x00, X8, X10
|
||||
PCLMULQDQ $0x11, X9, X6
|
||||
PXOR X10, X6
|
||||
PXOR 0x60(SI), X6
|
||||
VMOVDQA X7, X10
|
||||
PCLMULQDQ $0x00, X8, X10
|
||||
PCLMULQDQ $0x11, X9, X7
|
||||
PXOR X10, X7
|
||||
PXOR 0x70(SI), X7
|
||||
CMPQ CX, $1
|
||||
JGT loop128
|
||||
|
||||
tail128:
|
||||
MOVQ $0xd083dd594d96319d, AX
|
||||
MOVQ AX, X11
|
||||
PCLMULQDQ $0x00, X0, X11
|
||||
MOVQ $0x946588403d4adcbc, AX
|
||||
PINSRQ $0x1, AX, X12
|
||||
PCLMULQDQ $0x11, X12, X0
|
||||
PXOR X11, X7
|
||||
PXOR X0, X7
|
||||
MOVQ $0x3c255f5ebc414423, AX
|
||||
MOVQ AX, X11
|
||||
PCLMULQDQ $0x00, X1, X11
|
||||
MOVQ $0x34f5a24e22d66e90, AX
|
||||
PINSRQ $0x1, AX, X12
|
||||
PCLMULQDQ $0x11, X12, X1
|
||||
PXOR X11, X1
|
||||
PXOR X7, X1
|
||||
MOVQ $0x7b0ab10dd0f809fe, AX
|
||||
MOVQ AX, X11
|
||||
PCLMULQDQ $0x00, X2, X11
|
||||
MOVQ $0x03363823e6e791e5, AX
|
||||
PINSRQ $0x1, AX, X12
|
||||
PCLMULQDQ $0x11, X12, X2
|
||||
PXOR X11, X2
|
||||
PXOR X1, X2
|
||||
MOVQ $0x0c32cdb31e18a84a, AX
|
||||
MOVQ AX, X11
|
||||
PCLMULQDQ $0x00, X3, X11
|
||||
MOVQ $0x62242240ace5045a, AX
|
||||
PINSRQ $0x1, AX, X12
|
||||
PCLMULQDQ $0x11, X12, X3
|
||||
PXOR X11, X3
|
||||
PXOR X2, X3
|
||||
MOVQ $0xbdd7ac0ee1a4a0f0, AX
|
||||
MOVQ AX, X11
|
||||
PCLMULQDQ $0x00, X4, X11
|
||||
MOVQ $0xa3ffdc1fe8e82a8b, AX
|
||||
PINSRQ $0x1, AX, X12
|
||||
PCLMULQDQ $0x11, X12, X4
|
||||
PXOR X11, X4
|
||||
PXOR X3, X4
|
||||
MOVQ $0xb0bc2e589204f500, AX
|
||||
MOVQ AX, X11
|
||||
PCLMULQDQ $0x00, X5, X11
|
||||
MOVQ $0xe1e0bb9d45d7a44c, AX
|
||||
PINSRQ $0x1, AX, X12
|
||||
PCLMULQDQ $0x11, X12, X5
|
||||
PXOR X11, X5
|
||||
PXOR X4, X5
|
||||
MOVQ $0xeadc41fd2ba3d420, AX
|
||||
MOVQ AX, X11
|
||||
PCLMULQDQ $0x00, X6, X11
|
||||
MOVQ $0x21e9761e252621ac, AX
|
||||
PINSRQ $0x1, AX, X12
|
||||
PCLMULQDQ $0x11, X12, X6
|
||||
PXOR X11, X6
|
||||
PXOR X5, X6
|
||||
MOVQ AX, X5
|
||||
PCLMULQDQ $0x00, X6, X5
|
||||
PSHUFD $0xee, X6, X6
|
||||
PXOR X5, X6
|
||||
MOVQ $0x27ecfa329aef9f77, AX
|
||||
MOVQ AX, X4
|
||||
PCLMULQDQ $0x00, X4, X6
|
||||
PEXTRQ $0, X6, BX
|
||||
MOVQ $0x34d926535897936b, AX
|
||||
MOVQ AX, X4
|
||||
PCLMULQDQ $0x00, X4, X6
|
||||
PXOR X5, X6
|
||||
PEXTRQ $1, X6, AX
|
||||
XORQ BX, AX
|
||||
|
||||
skip128:
|
||||
NOTQ AX
|
||||
MOVQ AX, checksum+32(FP)
|
||||
RET
|
15
vendor/github.com/minio/crc64nvme/crc64_arm64.go
generated
vendored
Normal file
15
vendor/github.com/minio/crc64nvme/crc64_arm64.go
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2025 Minio Inc. All rights reserved.
|
||||
// Use of this source code is governed by a license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
//go:build !noasm && !appengine && !gccgo
|
||||
|
||||
package crc64nvme
|
||||
|
||||
import (
|
||||
"github.com/klauspost/cpuid/v2"
|
||||
)
|
||||
|
||||
var hasAsm = cpuid.CPU.Supports(cpuid.ASIMD) && cpuid.CPU.Supports(cpuid.PMULL)
|
||||
|
||||
func updateAsm(crc uint64, p []byte) (checksum uint64)
|
157
vendor/github.com/minio/crc64nvme/crc64_arm64.s
generated
vendored
Normal file
157
vendor/github.com/minio/crc64nvme/crc64_arm64.s
generated
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
// Copyright (c) 2025 Minio Inc. All rights reserved.
|
||||
// Use of this source code is governed by a license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
//go:build !noasm && !appengine && !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
TEXT ·updateAsm(SB), $0-40
|
||||
MOVD crc+0(FP), R0 // checksum
|
||||
MOVD p_base+8(FP), R1 // start pointer
|
||||
MOVD p_len+16(FP), R2 // length of buffer
|
||||
MOVD $·const(SB), R3 // constants
|
||||
MVN R0, R0
|
||||
LSR $7, R2, R2
|
||||
CMP $1, R2
|
||||
BLT skip128
|
||||
|
||||
FLDPQ (R1), (F0, F1)
|
||||
FLDPQ 32(R1), (F2, F3)
|
||||
FLDPQ 64(R1), (F4, F5)
|
||||
FLDPQ 96(R1), (F6, F7)
|
||||
FMOVD R0, F8
|
||||
VMOVI $0, V9.B16
|
||||
VMOV V9.D[0], V8.D[1]
|
||||
VEOR V8.B16, V0.B16, V0.B16
|
||||
CMP $1, R2
|
||||
BEQ tail128
|
||||
|
||||
MOVD 112(R3), R4
|
||||
MOVD 120(R3), R5
|
||||
FMOVD R4, F8
|
||||
VDUP R5, V9.D2
|
||||
|
||||
loop128:
|
||||
ADD $128, R1, R1
|
||||
SUB $1, R2, R2
|
||||
VPMULL V0.D1, V8.D1, V10.Q1
|
||||
VPMULL2 V0.D2, V9.D2, V0.Q1
|
||||
FLDPQ (R1), (F11, F12)
|
||||
VEOR3 V0.B16, V11.B16, V10.B16, V0.B16
|
||||
VPMULL V1.D1, V8.D1, V10.Q1
|
||||
VPMULL2 V1.D2, V9.D2, V1.Q1
|
||||
VEOR3 V1.B16, V12.B16, V10.B16, V1.B16
|
||||
VPMULL V2.D1, V8.D1, V10.Q1
|
||||
VPMULL2 V2.D2, V9.D2, V2.Q1
|
||||
FLDPQ 32(R1), (F11, F12)
|
||||
VEOR3 V2.B16, V11.B16, V10.B16, V2.B16
|
||||
VPMULL V3.D1, V8.D1, V10.Q1
|
||||
VPMULL2 V3.D2, V9.D2, V3.Q1
|
||||
VEOR3 V3.B16, V12.B16, V10.B16, V3.B16
|
||||
VPMULL V4.D1, V8.D1, V10.Q1
|
||||
VPMULL2 V4.D2, V9.D2, V4.Q1
|
||||
FLDPQ 64(R1), (F11, F12)
|
||||
VEOR3 V4.B16, V11.B16, V10.B16, V4.B16
|
||||
VPMULL V5.D1, V8.D1, V10.Q1
|
||||
VPMULL2 V5.D2, V9.D2, V5.Q1
|
||||
VEOR3 V5.B16, V12.B16, V10.B16, V5.B16
|
||||
VPMULL V6.D1, V8.D1, V10.Q1
|
||||
VPMULL2 V6.D2, V9.D2, V6.Q1
|
||||
FLDPQ 96(R1), (F11, F12)
|
||||
VEOR3 V6.B16, V11.B16, V10.B16, V6.B16
|
||||
VPMULL V7.D1, V8.D1, V10.Q1
|
||||
VPMULL2 V7.D2, V9.D2, V7.Q1
|
||||
VEOR3 V7.B16, V12.B16, V10.B16, V7.B16
|
||||
CMP $1, R2
|
||||
BHI loop128
|
||||
|
||||
tail128:
|
||||
MOVD (R3), R4
|
||||
FMOVD R4, F11
|
||||
VPMULL V0.D1, V11.D1, V11.Q1
|
||||
MOVD 8(R3), R4
|
||||
VDUP R4, V12.D2
|
||||
VPMULL2 V0.D2, V12.D2, V0.Q1
|
||||
VEOR3 V0.B16, V7.B16, V11.B16, V7.B16
|
||||
MOVD 16(R3), R4
|
||||
FMOVD R4, F11
|
||||
VPMULL V1.D1, V11.D1, V11.Q1
|
||||
MOVD 24(R3), R4
|
||||
VDUP R4, V12.D2
|
||||
VPMULL2 V1.D2, V12.D2, V1.Q1
|
||||
VEOR3 V1.B16, V11.B16, V7.B16, V1.B16
|
||||
MOVD 32(R3), R4
|
||||
FMOVD R4, F11
|
||||
VPMULL V2.D1, V11.D1, V11.Q1
|
||||
MOVD 40(R3), R4
|
||||
VDUP R4, V12.D2
|
||||
VPMULL2 V2.D2, V12.D2, V2.Q1
|
||||
VEOR3 V2.B16, V11.B16, V1.B16, V2.B16
|
||||
MOVD 48(R3), R4
|
||||
FMOVD R4, F11
|
||||
VPMULL V3.D1, V11.D1, V11.Q1
|
||||
MOVD 56(R3), R4
|
||||
VDUP R4, V12.D2
|
||||
VPMULL2 V3.D2, V12.D2, V3.Q1
|
||||
VEOR3 V3.B16, V11.B16, V2.B16, V3.B16
|
||||
MOVD 64(R3), R4
|
||||
FMOVD R4, F11
|
||||
VPMULL V4.D1, V11.D1, V11.Q1
|
||||
MOVD 72(R3), R4
|
||||
VDUP R4, V12.D2
|
||||
VPMULL2 V4.D2, V12.D2, V4.Q1
|
||||
VEOR3 V4.B16, V11.B16, V3.B16, V4.B16
|
||||
MOVD 80(R3), R4
|
||||
FMOVD R4, F11
|
||||
VPMULL V5.D1, V11.D1, V11.Q1
|
||||
MOVD 88(R3), R4
|
||||
VDUP R4, V12.D2
|
||||
VPMULL2 V5.D2, V12.D2, V5.Q1
|
||||
VEOR3 V5.B16, V11.B16, V4.B16, V5.B16
|
||||
MOVD 96(R3), R4
|
||||
FMOVD R4, F11
|
||||
VPMULL V6.D1, V11.D1, V11.Q1
|
||||
MOVD 104(R3), R4
|
||||
VDUP R4, V12.D2
|
||||
VPMULL2 V6.D2, V12.D2, V6.Q1
|
||||
VEOR3 V6.B16, V11.B16, V5.B16, V6.B16
|
||||
FMOVD R4, F5
|
||||
VPMULL V6.D1, V5.D1, V5.Q1
|
||||
VDUP V6.D[1], V6.D2
|
||||
VEOR V5.B8, V6.B8, V6.B8
|
||||
MOVD 128(R3), R4
|
||||
FMOVD R4, F4
|
||||
VPMULL V4.D1, V6.D1, V6.Q1
|
||||
FMOVD F6, R4
|
||||
MOVD 136(R3), R5
|
||||
FMOVD R5, F4
|
||||
VPMULL V4.D1, V6.D1, V6.Q1
|
||||
VEOR V6.B16, V5.B16, V6.B16
|
||||
VMOV V6.D[1], R5
|
||||
EOR R4, R5, R0
|
||||
|
||||
skip128:
|
||||
MVN R0, R0
|
||||
MOVD R0, checksum+32(FP)
|
||||
RET
|
||||
|
||||
DATA ·const+0x000(SB)/8, $0xd083dd594d96319d // K_959
|
||||
DATA ·const+0x008(SB)/8, $0x946588403d4adcbc // K_895
|
||||
DATA ·const+0x010(SB)/8, $0x3c255f5ebc414423 // K_831
|
||||
DATA ·const+0x018(SB)/8, $0x34f5a24e22d66e90 // K_767
|
||||
DATA ·const+0x020(SB)/8, $0x7b0ab10dd0f809fe // K_703
|
||||
DATA ·const+0x028(SB)/8, $0x03363823e6e791e5 // K_639
|
||||
DATA ·const+0x030(SB)/8, $0x0c32cdb31e18a84a // K_575
|
||||
DATA ·const+0x038(SB)/8, $0x62242240ace5045a // K_511
|
||||
DATA ·const+0x040(SB)/8, $0xbdd7ac0ee1a4a0f0 // K_447
|
||||
DATA ·const+0x048(SB)/8, $0xa3ffdc1fe8e82a8b // K_383
|
||||
DATA ·const+0x050(SB)/8, $0xb0bc2e589204f500 // K_319
|
||||
DATA ·const+0x058(SB)/8, $0xe1e0bb9d45d7a44c // K_255
|
||||
DATA ·const+0x060(SB)/8, $0xeadc41fd2ba3d420 // K_191
|
||||
DATA ·const+0x068(SB)/8, $0x21e9761e252621ac // K_127
|
||||
DATA ·const+0x070(SB)/8, $0xa1ca681e733f9c40 // K_1087
|
||||
DATA ·const+0x078(SB)/8, $0x5f852fb61e8d92dc // K_1023
|
||||
DATA ·const+0x080(SB)/8, $0x27ecfa329aef9f77 // MU
|
||||
DATA ·const+0x088(SB)/8, $0x34d926535897936b // POLY
|
||||
GLOBL ·const(SB), (NOPTR+RODATA), $144
|
11
vendor/github.com/minio/crc64nvme/crc64_other.go
generated
vendored
Normal file
11
vendor/github.com/minio/crc64nvme/crc64_other.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) 2025 Minio Inc. All rights reserved.
|
||||
// Use of this source code is governed by a license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
//go:build (!amd64 || noasm || appengine || gccgo) && (!arm64 || noasm || appengine || gccgo)
|
||||
|
||||
package crc64nvme
|
||||
|
||||
var hasAsm = false
|
||||
|
||||
func updateAsm(crc uint64, p []byte) (checksum uint64) { panic("should not be reached") }
|
85
vendor/github.com/minio/minio-go/v7/.golangci.yml
generated
vendored
85
vendor/github.com/minio/minio-go/v7/.golangci.yml
generated
vendored
@ -1,27 +1,72 @@
|
||||
linters-settings:
|
||||
misspell:
|
||||
locale: US
|
||||
|
||||
version: "2"
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- typecheck
|
||||
- goimports
|
||||
- misspell
|
||||
- revive
|
||||
- durationcheck
|
||||
- gocritic
|
||||
- gomodguard
|
||||
- govet
|
||||
- ineffassign
|
||||
- gosimple
|
||||
- misspell
|
||||
- revive
|
||||
- staticcheck
|
||||
- unconvert
|
||||
- unused
|
||||
- gocritic
|
||||
|
||||
- usetesting
|
||||
- whitespace
|
||||
settings:
|
||||
misspell:
|
||||
locale: US
|
||||
staticcheck:
|
||||
checks:
|
||||
- all
|
||||
- -SA1008
|
||||
- -SA1019
|
||||
- -SA4000
|
||||
- -SA9004
|
||||
- -ST1000
|
||||
- -ST1005
|
||||
- -ST1016
|
||||
- -ST1021
|
||||
- -ST1020
|
||||
- -U1000
|
||||
exclusions:
|
||||
generated: lax
|
||||
rules:
|
||||
- path: (.+)\.go$
|
||||
text: "empty-block:"
|
||||
- path: (.+)\.go$
|
||||
text: "unused-parameter:"
|
||||
- path: (.+)\.go$
|
||||
text: "dot-imports:"
|
||||
- path: (.+)\.go$
|
||||
text: "singleCaseSwitch: should rewrite switch statement to if statement"
|
||||
- path: (.+)\.go$
|
||||
text: "unlambda: replace"
|
||||
- path: (.+)\.go$
|
||||
text: "captLocal:"
|
||||
- path: (.+)\.go$
|
||||
text: "should have a package comment"
|
||||
- path: (.+)\.go$
|
||||
text: "ifElseChain:"
|
||||
- path: (.+)\.go$
|
||||
text: "elseif:"
|
||||
- path: (.+)\.go$
|
||||
text: "Error return value of"
|
||||
- path: (.+)\.go$
|
||||
text: "unnecessary conversion"
|
||||
- path: (.+)\.go$
|
||||
text: "Error return value is not checked"
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
exclude:
|
||||
# todo fix these when we get enough time.
|
||||
- "singleCaseSwitch: should rewrite switch statement to if statement"
|
||||
- "unlambda: replace"
|
||||
- "captLocal:"
|
||||
- "ifElseChain:"
|
||||
- "elseif:"
|
||||
- "should have a package comment"
|
||||
max-issues-per-linter: 100
|
||||
max-same-issues: 100
|
||||
formatters:
|
||||
enable:
|
||||
- gofumpt
|
||||
- goimports
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
1
vendor/github.com/minio/minio-go/v7/api-bucket-notification.go
generated
vendored
1
vendor/github.com/minio/minio-go/v7/api-bucket-notification.go
generated
vendored
@ -251,7 +251,6 @@ func (c *Client) ListenBucketNotification(ctx context.Context, bucketName, prefi
|
||||
|
||||
// Close current connection before looping further.
|
||||
closeResponse(resp)
|
||||
|
||||
}
|
||||
}(notificationInfoCh)
|
||||
|
||||
|
1
vendor/github.com/minio/minio-go/v7/api-bucket-versioning.go
generated
vendored
1
vendor/github.com/minio/minio-go/v7/api-bucket-versioning.go
generated
vendored
@ -90,6 +90,7 @@ type BucketVersioningConfiguration struct {
|
||||
// Requires versioning to be enabled
|
||||
ExcludedPrefixes []ExcludedPrefix `xml:",omitempty"`
|
||||
ExcludeFolders bool `xml:",omitempty"`
|
||||
PurgeOnDelete string `xml:",omitempty"`
|
||||
}
|
||||
|
||||
// Various supported states
|
||||
|
9
vendor/github.com/minio/minio-go/v7/api-compose-object.go
generated
vendored
9
vendor/github.com/minio/minio-go/v7/api-compose-object.go
generated
vendored
@ -30,6 +30,7 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/minio/minio-go/v7/pkg/encrypt"
|
||||
"github.com/minio/minio-go/v7/pkg/s3utils"
|
||||
"github.com/minio/minio-go/v7/pkg/tags"
|
||||
)
|
||||
|
||||
// CopyDestOptions represents options specified by user for CopyObject/ComposeObject APIs
|
||||
@ -98,8 +99,8 @@ func (opts CopyDestOptions) Marshal(header http.Header) {
|
||||
const replaceDirective = "REPLACE"
|
||||
if opts.ReplaceTags {
|
||||
header.Set(amzTaggingHeaderDirective, replaceDirective)
|
||||
if tags := s3utils.TagEncode(opts.UserTags); tags != "" {
|
||||
header.Set(amzTaggingHeader, tags)
|
||||
if tags, _ := tags.NewTags(opts.UserTags, true); tags != nil {
|
||||
header.Set(amzTaggingHeader, tags.String())
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,7 +237,9 @@ func (c *Client) copyObjectDo(ctx context.Context, srcBucket, srcObject, destBuc
|
||||
}
|
||||
|
||||
if len(dstOpts.UserTags) != 0 {
|
||||
headers.Set(amzTaggingHeader, s3utils.TagEncode(dstOpts.UserTags))
|
||||
if tags, _ := tags.NewTags(dstOpts.UserTags, true); tags != nil {
|
||||
headers.Set(amzTaggingHeader, tags.String())
|
||||
}
|
||||
}
|
||||
|
||||
reqMetadata := requestMetadata{
|
||||
|
2
vendor/github.com/minio/minio-go/v7/api-datatypes.go
generated
vendored
2
vendor/github.com/minio/minio-go/v7/api-datatypes.go
generated
vendored
@ -212,6 +212,8 @@ type ObjectInfo struct {
|
||||
// not to be confused with `Expires` HTTP header.
|
||||
Expiration time.Time
|
||||
ExpirationRuleID string
|
||||
// NumVersions is the number of versions of the object.
|
||||
NumVersions int
|
||||
|
||||
Restore *RestoreInfo
|
||||
|
||||
|
12
vendor/github.com/minio/minio-go/v7/api-get-object-acl.go
generated
vendored
12
vendor/github.com/minio/minio-go/v7/api-get-object-acl.go
generated
vendored
@ -135,16 +135,16 @@ func getAmzGrantACL(aCPolicy *accessControlPolicy) map[string][]string {
|
||||
res := map[string][]string{}
|
||||
|
||||
for _, g := range grants {
|
||||
switch {
|
||||
case g.Permission == "READ":
|
||||
switch g.Permission {
|
||||
case "READ":
|
||||
res["X-Amz-Grant-Read"] = append(res["X-Amz-Grant-Read"], "id="+g.Grantee.ID)
|
||||
case g.Permission == "WRITE":
|
||||
case "WRITE":
|
||||
res["X-Amz-Grant-Write"] = append(res["X-Amz-Grant-Write"], "id="+g.Grantee.ID)
|
||||
case g.Permission == "READ_ACP":
|
||||
case "READ_ACP":
|
||||
res["X-Amz-Grant-Read-Acp"] = append(res["X-Amz-Grant-Read-Acp"], "id="+g.Grantee.ID)
|
||||
case g.Permission == "WRITE_ACP":
|
||||
case "WRITE_ACP":
|
||||
res["X-Amz-Grant-Write-Acp"] = append(res["X-Amz-Grant-Write-Acp"], "id="+g.Grantee.ID)
|
||||
case g.Permission == "FULL_CONTROL":
|
||||
case "FULL_CONTROL":
|
||||
res["X-Amz-Grant-Full-Control"] = append(res["X-Amz-Grant-Full-Control"], "id="+g.Grantee.ID)
|
||||
}
|
||||
}
|
||||
|
66
vendor/github.com/minio/minio-go/v7/api-list.go
generated
vendored
66
vendor/github.com/minio/minio-go/v7/api-list.go
generated
vendored
@ -22,6 +22,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio-go/v7/pkg/s3utils"
|
||||
@ -421,20 +422,17 @@ func (c *Client) listObjectVersions(ctx context.Context, bucketName string, opts
|
||||
var (
|
||||
keyMarker = ""
|
||||
versionIDMarker = ""
|
||||
preName = ""
|
||||
preKey = ""
|
||||
perVersions []Version
|
||||
numVersions int
|
||||
)
|
||||
|
||||
for {
|
||||
// Get list of objects a maximum of 1000 per request.
|
||||
result, err := c.listObjectVersionsQuery(ctx, bucketName, opts, keyMarker, versionIDMarker, delimiter)
|
||||
if err != nil {
|
||||
sendObjectInfo(ObjectInfo{
|
||||
Err: err,
|
||||
})
|
||||
return
|
||||
send := func(vers []Version) {
|
||||
if opts.WithVersions && opts.ReverseVersions {
|
||||
slices.Reverse(vers)
|
||||
numVersions = len(vers)
|
||||
}
|
||||
|
||||
// If contents are available loop through and send over channel.
|
||||
for _, version := range result.Versions {
|
||||
for _, version := range vers {
|
||||
info := ObjectInfo{
|
||||
ETag: trimEtag(version.ETag),
|
||||
Key: version.Key,
|
||||
@ -448,6 +446,7 @@ func (c *Client) listObjectVersions(ctx context.Context, bucketName string, opts
|
||||
UserTags: version.UserTags,
|
||||
UserMetadata: version.UserMetadata,
|
||||
Internal: version.Internal,
|
||||
NumVersions: numVersions,
|
||||
}
|
||||
select {
|
||||
// Send object version info.
|
||||
@ -457,6 +456,38 @@ func (c *Client) listObjectVersions(ctx context.Context, bucketName string, opts
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
for {
|
||||
// Get list of objects a maximum of 1000 per request.
|
||||
result, err := c.listObjectVersionsQuery(ctx, bucketName, opts, keyMarker, versionIDMarker, delimiter)
|
||||
if err != nil {
|
||||
sendObjectInfo(ObjectInfo{
|
||||
Err: err,
|
||||
})
|
||||
return
|
||||
}
|
||||
if opts.WithVersions && opts.ReverseVersions {
|
||||
for _, version := range result.Versions {
|
||||
if preName == "" {
|
||||
preName = result.Name
|
||||
preKey = version.Key
|
||||
}
|
||||
if result.Name == preName && preKey == version.Key {
|
||||
// If the current name is same as previous name,
|
||||
// we need to append the version to the previous version.
|
||||
perVersions = append(perVersions, version)
|
||||
continue
|
||||
}
|
||||
// Send the file versions.
|
||||
send(perVersions)
|
||||
perVersions = perVersions[:0]
|
||||
perVersions = append(perVersions, version)
|
||||
preName = result.Name
|
||||
preKey = version.Key
|
||||
}
|
||||
} else {
|
||||
send(result.Versions)
|
||||
}
|
||||
|
||||
// Send all common prefixes if any.
|
||||
// NOTE: prefixes are only present if the request is delimited.
|
||||
@ -480,8 +511,17 @@ func (c *Client) listObjectVersions(ctx context.Context, bucketName string, opts
|
||||
versionIDMarker = result.NextVersionIDMarker
|
||||
}
|
||||
|
||||
// If context is canceled, return here.
|
||||
if contextCanceled(ctx) {
|
||||
return
|
||||
}
|
||||
|
||||
// Listing ends result is not truncated, return right here.
|
||||
if !result.IsTruncated {
|
||||
// sent the lasted file with versions
|
||||
if opts.ReverseVersions && len(perVersions) > 0 {
|
||||
send(perVersions)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -683,6 +723,8 @@ func (c *Client) listObjectsQuery(ctx context.Context, bucketName, objectPrefix,
|
||||
|
||||
// ListObjectsOptions holds all options of a list object request
|
||||
type ListObjectsOptions struct {
|
||||
// ReverseVersions - reverse the order of the object versions
|
||||
ReverseVersions bool
|
||||
// Include objects versions in the listing
|
||||
WithVersions bool
|
||||
// Include objects metadata in the listing
|
||||
|
1
vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go
generated
vendored
1
vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go
generated
vendored
@ -350,7 +350,6 @@ func (c *Client) putObjectMultipartStreamOptionalChecksum(ctx context.Context, b
|
||||
// Part number always starts with '1'.
|
||||
var partNumber int
|
||||
for partNumber = 1; partNumber <= totalPartsCount; partNumber++ {
|
||||
|
||||
// Proceed to upload the part.
|
||||
if partNumber == totalPartsCount {
|
||||
partSize = lastPartSize
|
||||
|
5
vendor/github.com/minio/minio-go/v7/api-put-object.go
generated
vendored
5
vendor/github.com/minio/minio-go/v7/api-put-object.go
generated
vendored
@ -30,6 +30,7 @@ import (
|
||||
|
||||
"github.com/minio/minio-go/v7/pkg/encrypt"
|
||||
"github.com/minio/minio-go/v7/pkg/s3utils"
|
||||
"github.com/minio/minio-go/v7/pkg/tags"
|
||||
"golang.org/x/net/http/httpguts"
|
||||
)
|
||||
|
||||
@ -229,7 +230,9 @@ func (opts PutObjectOptions) Header() (header http.Header) {
|
||||
}
|
||||
|
||||
if len(opts.UserTags) != 0 {
|
||||
header.Set(amzTaggingHeader, s3utils.TagEncode(opts.UserTags))
|
||||
if tags, _ := tags.NewTags(opts.UserTags, true); tags != nil {
|
||||
header.Set(amzTaggingHeader, tags.String())
|
||||
}
|
||||
}
|
||||
|
||||
for k, v := range opts.UserMetadata {
|
||||
|
5
vendor/github.com/minio/minio-go/v7/api-remove.go
generated
vendored
5
vendor/github.com/minio/minio-go/v7/api-remove.go
generated
vendored
@ -392,10 +392,7 @@ func (c *Client) removeObjects(ctx context.Context, bucketName string, objectsCh
|
||||
defer close(resultCh)
|
||||
|
||||
// Loop over entries by 1000 and call MultiDelete requests
|
||||
for {
|
||||
if finish {
|
||||
break
|
||||
}
|
||||
for !finish {
|
||||
count := 0
|
||||
var batch []ObjectInfo
|
||||
|
||||
|
1
vendor/github.com/minio/minio-go/v7/api-s3-datatypes.go
generated
vendored
1
vendor/github.com/minio/minio-go/v7/api-s3-datatypes.go
generated
vendored
@ -194,7 +194,6 @@ func (l *ListVersionsResult) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) (e
|
||||
default:
|
||||
return errors.New("unrecognized option:" + tagName)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
2
vendor/github.com/minio/minio-go/v7/api-select.go
generated
vendored
2
vendor/github.com/minio/minio-go/v7/api-select.go
generated
vendored
@ -609,7 +609,6 @@ func (s *SelectResults) start(pipeWriter *io.PipeWriter) {
|
||||
closeResponse(s.resp)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
}()
|
||||
}
|
||||
@ -669,7 +668,6 @@ func extractHeader(body io.Reader, myHeaders http.Header) error {
|
||||
}
|
||||
|
||||
myHeaders.Set(headerTypeName, headerValueName)
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
4
vendor/github.com/minio/minio-go/v7/api.go
generated
vendored
4
vendor/github.com/minio/minio-go/v7/api.go
generated
vendored
@ -155,7 +155,7 @@ type Options struct {
|
||||
// Global constants.
|
||||
const (
|
||||
libraryName = "minio-go"
|
||||
libraryVersion = "v7.0.85"
|
||||
libraryVersion = "v7.0.89"
|
||||
)
|
||||
|
||||
// User Agent should always following the below style.
|
||||
@ -598,7 +598,7 @@ func (c *Client) do(req *http.Request) (resp *http.Response, err error) {
|
||||
|
||||
// If trace is enabled, dump http request and response,
|
||||
// except when the traceErrorsOnly enabled and the response's status code is ok
|
||||
if c.isTraceEnabled && !(c.traceErrorsOnly && resp.StatusCode == http.StatusOK) {
|
||||
if c.isTraceEnabled && (!c.traceErrorsOnly || resp.StatusCode != http.StatusOK) {
|
||||
err = c.dumpHTTP(req, resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
7
vendor/github.com/minio/minio-go/v7/checksum.go
generated
vendored
7
vendor/github.com/minio/minio-go/v7/checksum.go
generated
vendored
@ -30,6 +30,8 @@ import (
|
||||
"math/bits"
|
||||
"net/http"
|
||||
"sort"
|
||||
|
||||
"github.com/minio/crc64nvme"
|
||||
)
|
||||
|
||||
// ChecksumType contains information about the checksum type.
|
||||
@ -152,9 +154,6 @@ func (c ChecksumType) RawByteLen() int {
|
||||
|
||||
const crc64NVMEPolynomial = 0xad93d23594c93659
|
||||
|
||||
// crc64 uses reversed polynomials.
|
||||
var crc64Table = crc64.MakeTable(bits.Reverse64(crc64NVMEPolynomial))
|
||||
|
||||
// Hasher returns a hasher corresponding to the checksum type.
|
||||
// Returns nil if no checksum.
|
||||
func (c ChecksumType) Hasher() hash.Hash {
|
||||
@ -168,7 +167,7 @@ func (c ChecksumType) Hasher() hash.Hash {
|
||||
case ChecksumSHA256:
|
||||
return sha256.New()
|
||||
case ChecksumCRC64NVME:
|
||||
return crc64.New(crc64Table)
|
||||
return crc64nvme.New()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
5
vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go
generated
vendored
5
vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go
generated
vendored
@ -104,6 +104,8 @@ type STSAssumeRoleOptions struct {
|
||||
RoleARN string
|
||||
RoleSessionName string
|
||||
ExternalID string
|
||||
|
||||
TokenRevokeType string // Optional, used for token revokation (MinIO only extension)
|
||||
}
|
||||
|
||||
// NewSTSAssumeRole returns a pointer to a new
|
||||
@ -161,6 +163,9 @@ func getAssumeRoleCredentials(clnt *http.Client, endpoint string, opts STSAssume
|
||||
if opts.ExternalID != "" {
|
||||
v.Set("ExternalId", opts.ExternalID)
|
||||
}
|
||||
if opts.TokenRevokeType != "" {
|
||||
v.Set("TokenRevokeType", opts.TokenRevokeType)
|
||||
}
|
||||
|
||||
u, err := url.Parse(endpoint)
|
||||
if err != nil {
|
||||
|
6
vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_custom_identity.go
generated
vendored
6
vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_custom_identity.go
generated
vendored
@ -69,6 +69,9 @@ type CustomTokenIdentity struct {
|
||||
// RequestedExpiry is to set the validity of the generated credentials
|
||||
// (this value bounded by server).
|
||||
RequestedExpiry time.Duration
|
||||
|
||||
// Optional, used for token revokation
|
||||
TokenRevokeType string
|
||||
}
|
||||
|
||||
// RetrieveWithCredContext with Retrieve optionally cred context
|
||||
@ -98,6 +101,9 @@ func (c *CustomTokenIdentity) RetrieveWithCredContext(cc *CredContext) (value Va
|
||||
if c.RequestedExpiry != 0 {
|
||||
v.Set("DurationSeconds", fmt.Sprintf("%d", int(c.RequestedExpiry.Seconds())))
|
||||
}
|
||||
if c.TokenRevokeType != "" {
|
||||
v.Set("TokenRevokeType", c.TokenRevokeType)
|
||||
}
|
||||
|
||||
u.RawQuery = v.Encode()
|
||||
|
||||
|
6
vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_ldap_identity.go
generated
vendored
6
vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_ldap_identity.go
generated
vendored
@ -73,6 +73,9 @@ type LDAPIdentity struct {
|
||||
// RequestedExpiry is the configured expiry duration for credentials
|
||||
// requested from LDAP.
|
||||
RequestedExpiry time.Duration
|
||||
|
||||
// Optional, used for token revokation
|
||||
TokenRevokeType string
|
||||
}
|
||||
|
||||
// NewLDAPIdentity returns new credentials object that uses LDAP
|
||||
@ -152,6 +155,9 @@ func (k *LDAPIdentity) RetrieveWithCredContext(cc *CredContext) (value Value, er
|
||||
if k.RequestedExpiry != 0 {
|
||||
v.Set("DurationSeconds", fmt.Sprintf("%d", int(k.RequestedExpiry.Seconds())))
|
||||
}
|
||||
if k.TokenRevokeType != "" {
|
||||
v.Set("TokenRevokeType", k.TokenRevokeType)
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(http.MethodPost, u.String(), strings.NewReader(v.Encode()))
|
||||
if err != nil {
|
||||
|
6
vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_tls_identity.go
generated
vendored
6
vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_tls_identity.go
generated
vendored
@ -80,6 +80,9 @@ type STSCertificateIdentity struct {
|
||||
// Certificate is the client certificate that is used for
|
||||
// STS authentication.
|
||||
Certificate tls.Certificate
|
||||
|
||||
// Optional, used for token revokation
|
||||
TokenRevokeType string
|
||||
}
|
||||
|
||||
// NewSTSCertificateIdentity returns a STSCertificateIdentity that authenticates
|
||||
@ -122,6 +125,9 @@ func (i *STSCertificateIdentity) RetrieveWithCredContext(cc *CredContext) (Value
|
||||
queryValues := url.Values{}
|
||||
queryValues.Set("Action", "AssumeRoleWithCertificate")
|
||||
queryValues.Set("Version", STSVersion)
|
||||
if i.TokenRevokeType != "" {
|
||||
queryValues.Set("TokenRevokeType", i.TokenRevokeType)
|
||||
}
|
||||
endpointURL.RawQuery = queryValues.Encode()
|
||||
|
||||
req, err := http.NewRequest(http.MethodPost, endpointURL.String(), nil)
|
||||
|
10
vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_web_identity.go
generated
vendored
10
vendor/github.com/minio/minio-go/v7/pkg/credentials/sts_web_identity.go
generated
vendored
@ -93,6 +93,9 @@ type STSWebIdentity struct {
|
||||
|
||||
// roleSessionName is the identifier for the assumed role session.
|
||||
roleSessionName string
|
||||
|
||||
// Optional, used for token revokation
|
||||
TokenRevokeType string
|
||||
}
|
||||
|
||||
// NewSTSWebIdentity returns a pointer to a new
|
||||
@ -135,7 +138,7 @@ func WithPolicy(policy string) func(*STSWebIdentity) {
|
||||
}
|
||||
|
||||
func getWebIdentityCredentials(clnt *http.Client, endpoint, roleARN, roleSessionName string, policy string,
|
||||
getWebIDTokenExpiry func() (*WebIdentityToken, error),
|
||||
getWebIDTokenExpiry func() (*WebIdentityToken, error), tokenRevokeType string,
|
||||
) (AssumeRoleWithWebIdentityResponse, error) {
|
||||
idToken, err := getWebIDTokenExpiry()
|
||||
if err != nil {
|
||||
@ -168,6 +171,9 @@ func getWebIdentityCredentials(clnt *http.Client, endpoint, roleARN, roleSession
|
||||
v.Set("Policy", policy)
|
||||
}
|
||||
v.Set("Version", STSVersion)
|
||||
if tokenRevokeType != "" {
|
||||
v.Set("TokenRevokeType", tokenRevokeType)
|
||||
}
|
||||
|
||||
u, err := url.Parse(endpoint)
|
||||
if err != nil {
|
||||
@ -236,7 +242,7 @@ func (m *STSWebIdentity) RetrieveWithCredContext(cc *CredContext) (Value, error)
|
||||
return Value{}, errors.New("STS endpoint unknown")
|
||||
}
|
||||
|
||||
a, err := getWebIdentityCredentials(client, stsEndpoint, m.RoleARN, m.roleSessionName, m.Policy, m.GetWebIDTokenExpiry)
|
||||
a, err := getWebIdentityCredentials(client, stsEndpoint, m.RoleARN, m.roleSessionName, m.Policy, m.GetWebIDTokenExpiry, m.TokenRevokeType)
|
||||
if err != nil {
|
||||
return Value{}, err
|
||||
}
|
||||
|
6
vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go
generated
vendored
6
vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go
generated
vendored
@ -192,7 +192,7 @@ func (t Transition) IsDaysNull() bool {
|
||||
|
||||
// IsDateNull returns true if date field is null
|
||||
func (t Transition) IsDateNull() bool {
|
||||
return t.Date.Time.IsZero()
|
||||
return t.Date.IsZero()
|
||||
}
|
||||
|
||||
// IsNull returns true if no storage-class is set.
|
||||
@ -323,7 +323,7 @@ type ExpirationDate struct {
|
||||
// MarshalXML encodes expiration date if it is non-zero and encodes
|
||||
// empty string otherwise
|
||||
func (eDate ExpirationDate) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error {
|
||||
if eDate.Time.IsZero() {
|
||||
if eDate.IsZero() {
|
||||
return nil
|
||||
}
|
||||
return e.EncodeElement(eDate.Format(time.RFC3339), startElement)
|
||||
@ -392,7 +392,7 @@ func (e Expiration) IsDaysNull() bool {
|
||||
|
||||
// IsDateNull returns true if date field is null
|
||||
func (e Expiration) IsDateNull() bool {
|
||||
return e.Date.Time.IsZero()
|
||||
return e.Date.IsZero()
|
||||
}
|
||||
|
||||
// IsDeleteMarkerExpirationEnabled returns true if the auto-expiration of delete marker is enabled
|
||||
|
9
vendor/github.com/minio/minio-go/v7/pkg/notification/notification.go
generated
vendored
9
vendor/github.com/minio/minio-go/v7/pkg/notification/notification.go
generated
vendored
@ -283,7 +283,6 @@ func (b *Configuration) AddTopic(topicConfig Config) bool {
|
||||
for _, n := range b.TopicConfigs {
|
||||
// If new config matches existing one
|
||||
if n.Topic == newTopicConfig.Arn.String() && newTopicConfig.Filter == n.Filter {
|
||||
|
||||
existingConfig := set.NewStringSet()
|
||||
for _, v := range n.Events {
|
||||
existingConfig.Add(string(v))
|
||||
@ -308,7 +307,6 @@ func (b *Configuration) AddQueue(queueConfig Config) bool {
|
||||
newQueueConfig := QueueConfig{Config: queueConfig, Queue: queueConfig.Arn.String()}
|
||||
for _, n := range b.QueueConfigs {
|
||||
if n.Queue == newQueueConfig.Arn.String() && newQueueConfig.Filter == n.Filter {
|
||||
|
||||
existingConfig := set.NewStringSet()
|
||||
for _, v := range n.Events {
|
||||
existingConfig.Add(string(v))
|
||||
@ -333,7 +331,6 @@ func (b *Configuration) AddLambda(lambdaConfig Config) bool {
|
||||
newLambdaConfig := LambdaConfig{Config: lambdaConfig, Lambda: lambdaConfig.Arn.String()}
|
||||
for _, n := range b.LambdaConfigs {
|
||||
if n.Lambda == newLambdaConfig.Arn.String() && newLambdaConfig.Filter == n.Filter {
|
||||
|
||||
existingConfig := set.NewStringSet()
|
||||
for _, v := range n.Events {
|
||||
existingConfig.Add(string(v))
|
||||
@ -372,7 +369,7 @@ func (b *Configuration) RemoveTopicByArnEventsPrefixSuffix(arn Arn, events []Eve
|
||||
removeIndex := -1
|
||||
for i, v := range b.TopicConfigs {
|
||||
// if it matches events and filters, mark the index for deletion
|
||||
if v.Topic == arn.String() && v.Config.Equal(events, prefix, suffix) {
|
||||
if v.Topic == arn.String() && v.Equal(events, prefix, suffix) {
|
||||
removeIndex = i
|
||||
break // since we have at most one matching config
|
||||
}
|
||||
@ -400,7 +397,7 @@ func (b *Configuration) RemoveQueueByArnEventsPrefixSuffix(arn Arn, events []Eve
|
||||
removeIndex := -1
|
||||
for i, v := range b.QueueConfigs {
|
||||
// if it matches events and filters, mark the index for deletion
|
||||
if v.Queue == arn.String() && v.Config.Equal(events, prefix, suffix) {
|
||||
if v.Queue == arn.String() && v.Equal(events, prefix, suffix) {
|
||||
removeIndex = i
|
||||
break // since we have at most one matching config
|
||||
}
|
||||
@ -428,7 +425,7 @@ func (b *Configuration) RemoveLambdaByArnEventsPrefixSuffix(arn Arn, events []Ev
|
||||
removeIndex := -1
|
||||
for i, v := range b.LambdaConfigs {
|
||||
// if it matches events and filters, mark the index for deletion
|
||||
if v.Lambda == arn.String() && v.Config.Equal(events, prefix, suffix) {
|
||||
if v.Lambda == arn.String() && v.Equal(events, prefix, suffix) {
|
||||
removeIndex = i
|
||||
break // since we have at most one matching config
|
||||
}
|
||||
|
48
vendor/github.com/minio/minio-go/v7/pkg/replication/replication.go
generated
vendored
48
vendor/github.com/minio/minio-go/v7/pkg/replication/replication.go
generated
vendored
@ -868,8 +868,20 @@ type ReplQNodeStats struct {
|
||||
XferStats map[MetricName]XferStats `json:"transferSummary"`
|
||||
TgtXferStats map[string]map[MetricName]XferStats `json:"tgtTransferStats"`
|
||||
|
||||
QStats InQueueMetric `json:"queueStats"`
|
||||
MRFStats ReplMRFStats `json:"mrfStats"`
|
||||
QStats InQueueMetric `json:"queueStats"`
|
||||
MRFStats ReplMRFStats `json:"mrfStats"`
|
||||
Retries CounterSummary `json:"retries"`
|
||||
Errors CounterSummary `json:"errors"`
|
||||
}
|
||||
|
||||
// CounterSummary denotes the stats counter summary
|
||||
type CounterSummary struct {
|
||||
// Counted last 1hr
|
||||
Last1hr uint64 `json:"last1hr"`
|
||||
// Counted last 1m
|
||||
Last1m uint64 `json:"last1m"`
|
||||
// Total counted since uptime
|
||||
Total uint64 `json:"total"`
|
||||
}
|
||||
|
||||
// ReplQueueStats holds stats for replication queue across nodes
|
||||
@ -914,8 +926,10 @@ type ReplQStats struct {
|
||||
XferStats map[MetricName]XferStats `json:"xferStats"`
|
||||
TgtXferStats map[string]map[MetricName]XferStats `json:"tgtXferStats"`
|
||||
|
||||
QStats InQueueMetric `json:"qStats"`
|
||||
MRFStats ReplMRFStats `json:"mrfStats"`
|
||||
QStats InQueueMetric `json:"qStats"`
|
||||
MRFStats ReplMRFStats `json:"mrfStats"`
|
||||
Retries CounterSummary `json:"retries"`
|
||||
Errors CounterSummary `json:"errors"`
|
||||
}
|
||||
|
||||
// QStats returns cluster level stats for objects in replication queue
|
||||
@ -958,6 +972,12 @@ func (q ReplQueueStats) QStats() (r ReplQStats) {
|
||||
r.MRFStats.LastFailedCount += node.MRFStats.LastFailedCount
|
||||
r.MRFStats.TotalDroppedCount += node.MRFStats.TotalDroppedCount
|
||||
r.MRFStats.TotalDroppedBytes += node.MRFStats.TotalDroppedBytes
|
||||
r.Retries.Last1hr += node.Retries.Last1hr
|
||||
r.Retries.Last1m += node.Retries.Last1m
|
||||
r.Retries.Total += node.Retries.Total
|
||||
r.Errors.Last1hr += node.Errors.Last1hr
|
||||
r.Errors.Last1m += node.Errors.Last1m
|
||||
r.Errors.Total += node.Errors.Total
|
||||
r.Uptime += node.Uptime
|
||||
}
|
||||
if len(q.Nodes) > 0 {
|
||||
@ -968,7 +988,21 @@ func (q ReplQueueStats) QStats() (r ReplQStats) {
|
||||
|
||||
// MetricsV2 represents replication metrics for a bucket.
|
||||
type MetricsV2 struct {
|
||||
Uptime int64 `json:"uptime"`
|
||||
CurrentStats Metrics `json:"currStats"`
|
||||
QueueStats ReplQueueStats `json:"queueStats"`
|
||||
Uptime int64 `json:"uptime"`
|
||||
CurrentStats Metrics `json:"currStats"`
|
||||
QueueStats ReplQueueStats `json:"queueStats"`
|
||||
DowntimeInfo map[string]DowntimeInfo `json:"downtimeInfo"`
|
||||
}
|
||||
|
||||
// DowntimeInfo represents the downtime info
|
||||
type DowntimeInfo struct {
|
||||
Duration Stat `json:"duration"`
|
||||
Count Stat `json:"count"`
|
||||
}
|
||||
|
||||
// Stat represents the aggregates
|
||||
type Stat struct {
|
||||
Total int64 `json:"total"`
|
||||
Avg int64 `json:"avg"`
|
||||
Max int64 `json:"max"`
|
||||
}
|
||||
|
40
vendor/github.com/minio/minio-go/v7/pkg/s3utils/utils.go
generated
vendored
40
vendor/github.com/minio/minio-go/v7/pkg/s3utils/utils.go
generated
vendored
@ -218,7 +218,7 @@ func IsAmazonPrivateLinkEndpoint(endpointURL url.URL) bool {
|
||||
if endpointURL == sentinelURL {
|
||||
return false
|
||||
}
|
||||
return amazonS3HostPrivateLink.MatchString(endpointURL.Host)
|
||||
return amazonS3HostPrivateLink.MatchString(endpointURL.Hostname())
|
||||
}
|
||||
|
||||
// IsGoogleEndpoint - Match if it is exactly Google cloud storage endpoint.
|
||||
@ -261,44 +261,6 @@ func QueryEncode(v url.Values) string {
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
// TagDecode - decodes canonical tag into map of key and value.
|
||||
func TagDecode(ctag string) map[string]string {
|
||||
if ctag == "" {
|
||||
return map[string]string{}
|
||||
}
|
||||
tags := strings.Split(ctag, "&")
|
||||
tagMap := make(map[string]string, len(tags))
|
||||
var err error
|
||||
for _, tag := range tags {
|
||||
kvs := strings.SplitN(tag, "=", 2)
|
||||
if len(kvs) == 0 {
|
||||
return map[string]string{}
|
||||
}
|
||||
if len(kvs) == 1 {
|
||||
return map[string]string{}
|
||||
}
|
||||
tagMap[kvs[0]], err = url.PathUnescape(kvs[1])
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
return tagMap
|
||||
}
|
||||
|
||||
// TagEncode - encodes tag values in their URL encoded form. In
|
||||
// addition to the percent encoding performed by urlEncodePath() used
|
||||
// here, it also percent encodes '/' (forward slash)
|
||||
func TagEncode(tags map[string]string) string {
|
||||
if tags == nil {
|
||||
return ""
|
||||
}
|
||||
values := url.Values{}
|
||||
for k, v := range tags {
|
||||
values[k] = []string{v}
|
||||
}
|
||||
return QueryEncode(values)
|
||||
}
|
||||
|
||||
// if object matches reserved string, no need to encode them
|
||||
var reservedObjectNames = regexp.MustCompile("^[a-zA-Z0-9-_.~/]+$")
|
||||
|
||||
|
@ -212,7 +212,6 @@ func (s *StreamingUSReader) Read(buf []byte) (int, error) {
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return s.buf.Read(buf)
|
||||
|
1
vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming.go
generated
vendored
1
vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-streaming.go
generated
vendored
@ -387,7 +387,6 @@ func (s *StreamingReader) Read(buf []byte) (int, error) {
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return s.buf.Read(buf)
|
||||
|
2
vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v2.go
generated
vendored
2
vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v2.go
generated
vendored
@ -148,7 +148,7 @@ func SignV2(req http.Request, accessKeyID, secretAccessKey string, virtualHost b
|
||||
|
||||
// Prepare auth header.
|
||||
authHeader := new(bytes.Buffer)
|
||||
authHeader.WriteString(fmt.Sprintf("%s %s:", signV2Algorithm, accessKeyID))
|
||||
fmt.Fprintf(authHeader, "%s %s:", signV2Algorithm, accessKeyID)
|
||||
encoder := base64.NewEncoder(base64.StdEncoding, authHeader)
|
||||
encoder.Write(hm.Sum(nil))
|
||||
encoder.Close()
|
||||
|
4
vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go
generated
vendored
4
vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go
generated
vendored
@ -128,8 +128,8 @@ func getCanonicalHeaders(req http.Request, ignoredHeaders map[string]bool) strin
|
||||
for _, k := range headers {
|
||||
buf.WriteString(k)
|
||||
buf.WriteByte(':')
|
||||
switch {
|
||||
case k == "host":
|
||||
switch k {
|
||||
case "host":
|
||||
buf.WriteString(getHostAddr(&req))
|
||||
buf.WriteByte('\n')
|
||||
default:
|
||||
|
11
vendor/github.com/minio/minio-go/v7/utils.go
generated
vendored
11
vendor/github.com/minio/minio-go/v7/utils.go
generated
vendored
@ -41,6 +41,7 @@ import (
|
||||
|
||||
md5simd "github.com/minio/md5-simd"
|
||||
"github.com/minio/minio-go/v7/pkg/s3utils"
|
||||
"github.com/minio/minio-go/v7/pkg/tags"
|
||||
)
|
||||
|
||||
func trimEtag(etag string) string {
|
||||
@ -322,7 +323,13 @@ func ToObjectInfo(bucketName, objectName string, h http.Header) (ObjectInfo, err
|
||||
userMetadata[strings.TrimPrefix(k, "X-Amz-Meta-")] = v[0]
|
||||
}
|
||||
}
|
||||
userTags := s3utils.TagDecode(h.Get(amzTaggingHeader))
|
||||
|
||||
userTags, err := tags.ParseObjectTags(h.Get(amzTaggingHeader))
|
||||
if err != nil {
|
||||
return ObjectInfo{}, ErrorResponse{
|
||||
Code: "InternalError",
|
||||
}
|
||||
}
|
||||
|
||||
var tagCount int
|
||||
if count := h.Get(amzTaggingCount); count != "" {
|
||||
@ -373,7 +380,7 @@ func ToObjectInfo(bucketName, objectName string, h http.Header) (ObjectInfo, err
|
||||
// which are not part of object metadata.
|
||||
Metadata: metadata,
|
||||
UserMetadata: userMetadata,
|
||||
UserTags: userTags,
|
||||
UserTags: userTags.ToMap(),
|
||||
UserTagCount: tagCount,
|
||||
Restore: restore,
|
||||
|
||||
|
Reference in New Issue
Block a user