Documentation
¶
Index ¶
- func CreateDirectory(path string) error
- func CreatePIDFile(pidFilePath string) error
- func DetectMimeType(path string) string
- func IsImageFile(mimeType string) bool
- func IsTextFile(mimeType string) bool
- func MergeJSONToStruct(target any, jsonMap map[string]any) error
- func PathToResourceURI(path string) string
- func RemovePIDFile(pidFilePath string) error
- func StringInSlice(s string, modules []string) bool
- type RotateWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirectory ¶
CreateDirectory checks if a directory exists, and creates it if it doesn't
func CreatePIDFile ¶
CreatePIDFile creates and locks a PID file to prevent multiple instances.
func DetectMimeType ¶
DetectMimeType tries to determine the MIME type of a file
func IsImageFile ¶
IsImageFile determines if a file is an image based on MIME type
func IsTextFile ¶
IsTextFile determines if a file is likely a text file based on MIME type
func MergeJSONToStruct ¶
MergeJSONToStruct 将JSON中的字段合并到结构体中
func PathToResourceURI ¶
PathToResourceURI converts a file path to a resource URI
func RemovePIDFile ¶
RemovePIDFile releases the lock and removes the PID file.
func StringInSlice ¶
StringInSlice checks if a string is in a slice of strings
Types ¶
type RotateWriter ¶
type RotateWriter struct {
// contains filtered or unexported fields
}
RotateWriter 是一个简单的日志轮转写入器
func NewRotateWriter ¶
func NewRotateWriter(filePath string, maxSize int64) (*RotateWriter, error)
NewRotateWriter 创建一个新的 RotateWriter 实例
func (*RotateWriter) CheckFileSize ¶
func (rw *RotateWriter) CheckFileSize() error
CheckFileSize 检查当前文件大小
Click to show internal directories.
Click to hide internal directories.