mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Build / docker-build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
* feat(add): add support for naming pinned CID Signed-off-by: kapil <kapilsareen584@gmail.com> * fix(add): no double pinning and simplify pin-name - modify PinRoot to accept name parameter, eliminating double pinning - remove automatic filename fallback logic for cleaner behavior - only create named pins when explicitly requested via --pin-name=value - replace NoPinName constant with idiomatic empty string literals - Update help text and tests to reflect explicit-only behavior * docs: changelog * chore: lint * test: negative case for empty pin-name * chore: gofmt --------- Signed-off-by: kapil <kapilsareen584@gmail.com> Co-authored-by: Marcin Rataj <lidel@lidel.org>
46 lines
1.7 KiB
Go
46 lines
1.7 KiB
Go
package config
|
|
|
|
import (
|
|
"github.com/ipfs/boxo/ipld/unixfs/importer/helpers"
|
|
"github.com/ipfs/boxo/ipld/unixfs/io"
|
|
)
|
|
|
|
const (
|
|
DefaultCidVersion = 0
|
|
DefaultUnixFSRawLeaves = false
|
|
DefaultUnixFSChunker = "size-262144"
|
|
DefaultHashFunction = "sha2-256"
|
|
|
|
DefaultUnixFSHAMTDirectorySizeThreshold = "256KiB" // https://github.com/ipfs/boxo/blob/6c5a07602aed248acc86598f30ab61923a54a83e/ipld/unixfs/io/directory.go#L26
|
|
|
|
// DefaultBatchMaxNodes controls the maximum number of nodes in a
|
|
// write-batch. The total size of the batch is limited by
|
|
// BatchMaxnodes and BatchMaxSize.
|
|
DefaultBatchMaxNodes = 128
|
|
// DefaultBatchMaxSize controls the maximum size of a single
|
|
// write-batch. The total size of the batch is limited by
|
|
// BatchMaxnodes and BatchMaxSize.
|
|
DefaultBatchMaxSize = 100 << 20 // 20MiB
|
|
)
|
|
|
|
var (
|
|
DefaultUnixFSFileMaxLinks = int64(helpers.DefaultLinksPerBlock)
|
|
DefaultUnixFSDirectoryMaxLinks = int64(0)
|
|
DefaultUnixFSHAMTDirectoryMaxFanout = int64(io.DefaultShardWidth)
|
|
)
|
|
|
|
// Import configures the default options for ingesting data. This affects commands
|
|
// that ingest data, such as 'ipfs add', 'ipfs dag put, 'ipfs block put', 'ipfs files write'.
|
|
type Import struct {
|
|
CidVersion OptionalInteger
|
|
UnixFSRawLeaves Flag
|
|
UnixFSChunker OptionalString
|
|
HashFunction OptionalString
|
|
UnixFSFileMaxLinks OptionalInteger
|
|
UnixFSDirectoryMaxLinks OptionalInteger
|
|
UnixFSHAMTDirectoryMaxFanout OptionalInteger
|
|
UnixFSHAMTDirectorySizeThreshold OptionalString
|
|
BatchMaxNodes OptionalInteger
|
|
BatchMaxSize OptionalInteger
|
|
}
|