Documentation ¶
Index ¶
- Constants
- func IsFileSrc(src string) (bool, error)
- func ToRelative(filepath string) string
- type PathResolver
- func (r *PathResolver) PrefixedPath(filepath string) string
- func (r *PathResolver) Pull(source, destinationOverride string) *ResolvedPath
- func (r *PathResolver) Push(source, destinationOverride string) *ResolvedPath
- func (r *PathResolver) Resolve(operation, source, destinationOverride string) (*ResolvedPath, error)
- func (r *PathResolver) Yank(file string) *ResolvedPath
- type ResolvedPath
Constants ¶
View Source
const ( ResourceTypeProject = "project" ResourceTypeWorkflow = "workflow" ResourceTypeJob = "job" OperationPush = "push" OperationPull = "pull" OperationYank = "yank" )
Variables ¶
This section is empty.
Functions ¶
func ToRelative ¶
Removes all ./, ../ etc prefixes from the string.
Types ¶
type PathResolver ¶
type PathResolver struct { ResourceType string ResourceTypePlural string ResourceIdentifier string }
func NewPathResolver ¶
func NewPathResolver(resourceType, resourceId string) (*PathResolver, error)
func (*PathResolver) PrefixedPath ¶
func (r *PathResolver) PrefixedPath(filepath string) string
* Get resource-prefixed paths for paths in remote storage. * * For project: artifacts/projects/<SEMAPHORE_PROJECT_ID>/x.zip * For workflow: artifacts/workflows/<SEMAPHORE_WORKFLOW_ID>/x.zip * For job: artifacts/jobs/<SEMAPHORE_JOB_ID>/x.zip
func (*PathResolver) Pull ¶
func (r *PathResolver) Pull(source, destinationOverride string) *ResolvedPath
func (*PathResolver) Push ¶
func (r *PathResolver) Push(source, destinationOverride string) *ResolvedPath
func (*PathResolver) Resolve ¶
func (r *PathResolver) Resolve(operation, source, destinationOverride string) (*ResolvedPath, error)
func (*PathResolver) Yank ¶
func (r *PathResolver) Yank(file string) *ResolvedPath
type ResolvedPath ¶
Click to show internal directories.
Click to hide internal directories.