file

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedFileInfo

type ExtendedFileInfo struct {
	FileInformation
	os.FileInfo
}

ExtendedFileInfo is combined receiver for os.FileInfo functions and ContentType()

type ExtendedFileInfoImplementer

type ExtendedFileInfoImplementer interface {
	os.FileInfo
	FileInformationImplementer
}

func ExtendedFileInformation

func ExtendedFileInformation(absoluteFilePath string, fileInfo os.FileInfo) ExtendedFileInfoImplementer

func GetFileInformation

func GetFileInformation(absoluteFilePath string) (ExtendedFileInfoImplementer, error)

type FileInformation

type FileInformation struct {
	// contains filtered or unexported fields
}

func (*FileInformation) Checksum added in v1.4.0

func (i *FileInformation) Checksum() (string, error)

Checksum returns a string representation of SHA-512/256 checksum

func (*FileInformation) ContentType

func (i *FileInformation) ContentType() (string, error)

ContentType returns mime type of the file as a string source: https://golangcode.com/get-the-content-type-of-file/

type FileInformationImplementer

type FileInformationImplementer interface {
	ContentType() (string, error)
	Checksum() (string, error)
}

Jump to

Keyboard shortcuts

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