server: go.chromium.org/goma/server/command/pathconv Index | Files

package pathconv

import "go.chromium.org/goma/server/command/pathconv"

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

Package Files

converter.go doc.go nop.go

type PathConverter Uses

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 Uses

func Default() PathConverter

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

Package pathconv imports 2 packages (graph). Updated 2019-11-15. Refresh now. Tools for package owners.