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