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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user