Documentation ¶
Overview ¶
Package files contains functions and structs related to files
Index ¶
- Constants
- func AddToFiles(filePaths []string, filePath string, config config.Config) []string
- func GetContentType(path string, config config.Config) (string, error)
- func GetContentTypeBytes(rawFileContent []byte, config config.Config) (string, error)
- func GetFiles(config config.Config) ([]string, error)
- func GetRelativePath(filePath string) (string, error)
- func IsAllowedContentType(contentType string, config config.Config) bool
- func IsExcluded(filePath string, config config.Config) (bool, error)
- func PathExists(filePath string) bool
- func ReadLines(content string) []string
- type FileInformation
Constants ¶
View Source
const DefaultMimeType = "application/octet-stream"
Variables ¶
This section is empty.
Functions ¶
func AddToFiles ¶
AddToFiles adds a file to a slice if it isn't already in there and meets the requirements and returns the new slice
func GetContentType ¶
GetContentType returns the content type of a file
func GetContentTypeBytes ¶
GetContentTypeBytes returns the content type of a byte slice
func GetRelativePath ¶
GetRelativePath returns the relative path of a file from the current working directory
func IsAllowedContentType ¶
IsAllowedContentType returns whether the contentType is an allowed content type to check or not
func IsExcluded ¶
IsExcluded returns whether the file is excluded via arguments or config file
func PathExists ¶
PathExists checks whether a path of a file or directory exists or not
Types ¶
Click to show internal directories.
Click to hide internal directories.