Documentation ¶
Index ¶
- type Location
- func (p Location) AppendKey(key string) Location
- func (p Location) Base() (string, bool)
- func (p Location) HasPrefix(loc Location) bool
- func (p Location) Key() string
- func (p Location) Less(q Location) bool
- func (p Location) ListKeyName(prefix Location) (string, bool)
- 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) RemoveKeyPrefix(prefix string) Location
- func (p Location) SetKey(s string) Location
- func (p Location) Std() bool
- func (p Location) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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) 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) 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) RemoveKeyPrefix ¶
RemoveKeyPrefix removes the prefix from the key or path in the location if they begin with it.