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.
|
2019-05-23 01:31:11 +08:00
|
|
|
package protocol
|
|
|
|
|
2022-08-18 23:54:48 +08:00
|
|
|
import "github.com/libp2p/go-libp2p/core/protocol"
|
|
|
|
|
2019-05-23 01:31:11 +08:00
|
|
|
// 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
|
2019-05-23 01:31:11 +08:00
|
|
|
|
|
|
|
// 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
|
2019-05-23 01:31:11 +08:00
|
|
|
)
|
2019-06-20 22:59:53 +08:00
|
|
|
|
|
|
|
// 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
|
2019-06-20 22:59:53 +08:00
|
|
|
func ConvertFromStrings(ids []string) (res []ID) {
|
2022-08-18 23:54:48 +08:00
|
|
|
return protocol.ConvertFromStrings(ids)
|
2019-06-20 22:59:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
2019-06-20 22:59:53 +08:00
|
|
|
func ConvertToStrings(ids []ID) (res []string) {
|
2022-08-18 23:54:48 +08:00
|
|
|
return protocol.ConvertToStrings(ids)
|
2019-06-20 22:59:53 +08:00
|
|
|
}
|