internal

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirInfo

func DirInfo(name string, modTime time.Time) fs.FileInfo

DirInfo creates a fs.FileInfo for a directory with the given name. Use FileInfo to set other values.

func FileInfo

func FileInfo(name string, size int64, mode fs.FileMode, modTime time.Time, contentType string) fs.FileInfo

FileInfo creates a static fs.FileInfo with the given properties. The result is also a fs.DirEntry and can be safely cast.

func FileInfoDirEntry

func FileInfoDirEntry(fi fs.FileInfo) fs.DirEntry

FileInfoDirEntry adapts a fs.FileInfo into a fs.DirEntry. If it doesn't already implement fs.DirEntry, it will be wrapped to always return the same fs.FileInfo.

func SubURL added in v0.1.3

func SubURL(base *url.URL, name string) (*url.URL, error)

func ValidPath

func ValidPath(name string) bool

Types

type ContentTypeFileInfo

type ContentTypeFileInfo interface {
	fs.FileInfo

	ContentType() string
}

ContentTypeFileInfo is an fs.FileInfo that can also report its content type

type WithContexter

type WithContexter interface {
	WithContext(ctx context.Context) fs.FS
}

WithContexter is an fs.FS that can be configured with a custom context

type WithHTTPClienter

type WithHTTPClienter interface {
	WithHTTPClient(client *http.Client) fs.FS
}

WithHTTPClienter is an fs.FS that can be configured with a custom http.Client

type WithHeaderer

type WithHeaderer interface {
	WithHeader(headers http.Header) fs.FS
}

WithHeaderer is an fs.FS that can be configured to send a custom http.Header

type WithIMDSFSer added in v0.2.1

type WithIMDSFSer interface {
	WithIMDSFS(imdsfs fs.FS) fs.FS
}

WithIMDSFSer overrides the IMDS filesystem used by fs, if the filesystem supports it (i.e. has a WithIMDSFS method). This can be used for overriding the IMDS filesystem used by the fs to discover the region.

Directories

Path Synopsis
Package env contains functions that retrieve data from the environment
Package env contains functions that retrieve data from the environment

Jump to

Keyboard shortcuts

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