filename

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package filename provides types for representing files on disk and files inside of tarfiles. Using these types can help ensure that function arguments don't mix up the two categories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Internal

type Internal string

Internal is the pathname of a data file inside of the tarfile.

func (Internal) Lint

func (l Internal) Lint() error

Lint returns nil if the file has a normal name, and an explanatory error about why the name is strange otherwise.

func (Internal) Subdir

func (l Internal) Subdir() string

Subdir returns the subdirectory of the Internal filename, up to 3 levels deep. It is only guaranteed to work right on relative path names, suitable for inclusion in tarfiles.

type System

type System string

System contains a filename suitable for passing directly to os.Remove.

func (System) Internal

func (s System) Internal(rootDirectory System) Internal

Internal removes the path information that is not relevant to the tarfile.

Jump to

Keyboard shortcuts

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