Documentation ¶
Index ¶
- func CleanPath(path string) string
- type Location
- func (p Location) AppendKey(key string) Location
- func (p Location) AsDirectoryish() Location
- func (p Location) Base() (string, bool)
- func (p Location) Directoryish() bool
- func (p Location) HasPrefix(pre Location) bool
- func (p Location) Less(q Location) bool
- func (p Location) ListKeyName(prefix Location) (string, bool)
- func (p Location) Loc() string
- func (p Location) Local() bool
- func (p Location) LocalParts() (path string, ok bool)
- func (p Location) Parent() string
- func (p Location) RelativeTo(target Location) (string, error)
- func (p Location) Remote() bool
- func (p Location) RemoteParts() (bucket, key string, ok bool)
- func (p Location) RemovePrefix(prefix Location) Location
- func (p Location) Std() bool
- func (p Location) String() string
- func (p Location) Undirectoryish() Location
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
Location represets a local path, a remote object, or stdin/stdout.
func Parse ¶
Parse turns the string form of the location into the structured Location value and an error if it is unable to or the location is invalid.
func (Location) AppendKey ¶
AppendKey adds the key to the end of the existing key, separating with the appropriate slash if necessary.
func (Location) AsDirectoryish ¶
AsDirectoryish appends a trailing slash to the location if it is not already directoryish.
func (Location) Base ¶
Base returns the last base component of the key or path not including the last slash.
func (Location) Directoryish ¶
Directoryish returns if the location is syntatically directoryish, meaning that the location component is either empty or ends with a slash.
func (Location) ListKeyName ¶
ListKeyName returns the full first component of the key after the provided prefix and a boolean indicating if the component is itself a prefix.
func (Location) LocalParts ¶
LocalParts returns the path for the location and a bool indicating if that value is valid because the location is local.
func (Location) Parent ¶
Parent returns the section of the key or path up to and including the final slash.
func (Location) RelativeTo ¶
RelativeTo returns the string that when appended to the location string will return a string equivalent to the passed in target location.
func (Location) RemoteParts ¶
RemoteParts returns the bucket and key for the location and a bool indicating if those values are valid because the location is remote.
func (Location) RemovePrefix ¶
RemovePrefix removes the prefix from the key or path in the location if they begin with it.
func (Location) Undirectoryish ¶
Undirectoryish removes any trailing slashes from the location.