pathconv

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package pathconv provides path converter between client and server.

TODO: Do we want to introduce ClientPath and ServerPath type so that we won't be confused the path is client path or server path?

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathConverter

type PathConverter interface {
	// ToClientPath converts a server path to a client path.
	ToClientPath(string) (string, error)

	// ToServerPath converts an absolute client path to a server path.
	ToServerPath(string) (string, error)

	// IsAbsClient reports whether the path is absolute as client path.
	IsAbsClient(string) bool

	// JoinClient joins any number of path elements into a single path.
	JoinClient(elem ...string) string

	// IsSafeClient reports whether the path is safe absolute path
	// (not go out from root directory).
	// It returns false for relative path.
	IsSafeClient(string) bool
}

PathConverter provides path conversion between a client path and a server path. It also provides client path utilities.

func Default

func Default() PathConverter

Default returns a path converter for the case server and client are both same posix path namesystem.

Jump to

Keyboard shortcuts

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