2020-05-12 02:57:46 +08:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package storj
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2020-05-29 21:08:11 +08:00
|
|
|
// Path represents a object path.
|
2020-05-12 02:57:46 +08:00
|
|
|
type Path = string
|
|
|
|
|
2020-05-29 21:08:11 +08:00
|
|
|
// SplitPath splits path into a slice of path components.
|
2020-05-12 02:57:46 +08:00
|
|
|
func SplitPath(path Path) []string {
|
|
|
|
return strings.Split(path, "/")
|
|
|
|
}
|
|
|
|
|
2020-05-29 21:08:11 +08:00
|
|
|
// JoinPaths concatenates paths to a new single path.
|
2020-05-12 02:57:46 +08:00
|
|
|
func JoinPaths(paths ...Path) Path {
|
|
|
|
return strings.Join(paths, "/")
|
|
|
|
}
|