internal

package
v0.0.0-...-7d77a24 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 5 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 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

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