file

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 8 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientOriginalExtension added in v1.5.0

func ClientOriginalExtension(file string) string

func Contain added in v1.2.3

func Contain(file string, search string) bool

func Create

func Create(file string, content string) error

Create a file with the given content Deprecated: Use PutContent instead

func Exists added in v1.5.0

func Exists(file string) bool

func Extension added in v1.5.0

func Extension(file string, originalWhenUnknown ...bool) (string, error)

Extension Supported types: https://github.com/gabriel-vasile/mimetype/blob/master/supported_mimes.md

func GetContent added in v1.15.12

func GetContent(file string) (string, error)

func GetFrameworkContent added in v1.15.12

func GetFrameworkContent(file string) (string, error)

func GetPackageContent added in v1.15.12

func GetPackageContent(pkgName, file string) (string, error)

func LastModified added in v1.11.1

func LastModified(file, timezone string) (time.Time, error)

func MimeType added in v1.11.1

func MimeType(file string) (string, error)

func PutContent added in v1.15.12

func PutContent(file string, content string, options ...Option) error

func Remove

func Remove(file string) error

func Size added in v1.11.1

func Size(file string) (int64, error)

Types

type Option added in v1.15.12

type Option func(*option)

Option represents an option for FilePutContents

func WithAppend added in v1.15.12

func WithAppend(append bool) Option

WithAppend sets the append mode for FilePutContents

func WithMode added in v1.15.12

func WithMode(mode os.FileMode) Option

WithMode sets the file mode for FilePutContents

Jump to

Keyboard shortcuts

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