go-libp2p-core/protocol/id.go

29 lines
1.1 KiB
Go
Raw Normal View History

2022-08-18 23:54:48 +08:00
// Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/core/protocol.
package protocol
2022-08-18 23:54:48 +08:00
import "github.com/libp2p/go-libp2p/core/protocol"
// ID is an identifier used to write protocol headers in streams.
2022-08-18 23:54:48 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/core/protocol.ID instead
type ID = protocol.ID
// These are reserved protocol.IDs.
const (
2022-08-18 23:54:48 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/core/protocol.TestingID instead
TestingID ID = protocol.TestingID
)
// ConvertFromStrings is a convenience function that takes a slice of strings and
// converts it to a slice of protocol.ID.
2022-08-18 23:54:48 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/core/protocol.ConvertFromStrings instead
func ConvertFromStrings(ids []string) (res []ID) {
2022-08-18 23:54:48 +08:00
return protocol.ConvertFromStrings(ids)
}
// ConvertToStrings is a convenience function that takes a slice of protocol.ID and
// converts it to a slice of strings.
2022-08-18 23:54:48 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/core/protocol.ConvertToStrings instead
func ConvertToStrings(ids []ID) (res []string) {
2022-08-18 23:54:48 +08:00
return protocol.ConvertToStrings(ids)
}