1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-17 15:06:47 +08:00

feat: support optional pin names (#10261)

This commit is contained in:
Henrique Dias
2024-01-04 14:25:06 +01:00
committed by GitHub
parent 765cffe6c2
commit a8a6bbe929
22 changed files with 200 additions and 60 deletions

View File

@ -26,6 +26,7 @@ type pinRefKeyList struct {
type pin struct {
path path.ImmutablePath
typ string
name string
err error
}
@ -37,6 +38,10 @@ func (p pin) Path() path.ImmutablePath {
return p.path
}
func (p pin) Name() string {
return p.name
}
func (p pin) Type() string {
return p.typ
}
@ -53,6 +58,7 @@ func (api *PinAPI) Add(ctx context.Context, p path.Path, opts ...caopts.PinAddOp
type pinLsObject struct {
Cid string
Name string
Type string
}
@ -102,7 +108,7 @@ func (api *PinAPI) Ls(ctx context.Context, opts ...caopts.PinLsOption) (<-chan i
}
select {
case ch <- pin{typ: out.Type, path: path.FromCid(c)}:
case ch <- pin{typ: out.Type, name: out.Name, path: path.FromCid(c)}:
case <-ctx.Done():
return
}