xfilepath

package
v0.0.0-...-7149754 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package xfilepath defines functions to define path retrievers that support error handling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathRetriever

type PathRetriever func() (path string, err error)

PathRetriever is a function that retrieve the contained path or an error

func Join

func Join(paths ...PathRetriever) PathRetriever

Join returns a path retriever from the join of the provided path retrievers The returned path retriever eventually returns the error from the first provided path retrievers that returns a non-nil error

func JoinFromHome

func JoinFromHome(paths ...PathRetriever) PathRetriever

JoinFromHome returns a path retriever from the join of the user home and the provided path retrievers The returned path retriever eventually returns the error from the first provided path retrievers that returns a non-nil error

func Path

func Path(path string) PathRetriever

Path returns a path retriever from the provided path

func PathWithError

func PathWithError(path string, err error) PathRetriever

PathWithError returns a path retriever from the provided path and error

type PathsRetriever

type PathsRetriever func() (path []string, err error)

PathsRetriever is a function that retrieve the contained list of paths or an error

func List

func List(paths ...PathRetriever) PathsRetriever

List returns a paths retriever from a list of path retrievers The returned paths retriever eventually returns the error from the first provided path retrievers that returns a non-nil error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL