Cleanup
This commit is contained in:
parent
c0c940156f
commit
771b40e82e
@ -1,10 +1,5 @@
|
|||||||
package goldsmith
|
package goldsmith
|
||||||
|
|
||||||
import (
|
|
||||||
"io"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Plugin contains the minimum set of methods required on plugins. Plugins can
|
// Plugin contains the minimum set of methods required on plugins. Plugins can
|
||||||
// also optionally implement Initializer, Processor, and Finalizer interfaces.
|
// also optionally implement Initializer, Processor, and Finalizer interfaces.
|
||||||
type Plugin interface {
|
type Plugin interface {
|
||||||
@ -33,33 +28,3 @@ type Filter interface {
|
|||||||
Name() string
|
Name() string
|
||||||
Accept(file File) bool
|
Accept(file File) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type (
|
|
||||||
FileProp any
|
|
||||||
FileProps map[string]FileProp
|
|
||||||
)
|
|
||||||
|
|
||||||
// File represents in-memory or on-disk files in a chain.
|
|
||||||
type File interface {
|
|
||||||
Path() string
|
|
||||||
Dir() string
|
|
||||||
Name() string
|
|
||||||
Ext() string
|
|
||||||
Rename(path string) error
|
|
||||||
|
|
||||||
Size() int64
|
|
||||||
ModTime() time.Time
|
|
||||||
|
|
||||||
Read(data []byte) (int, error)
|
|
||||||
WriteTo(writer io.Writer) (int64, error)
|
|
||||||
Seek(offset int64, whence int) (int64, error)
|
|
||||||
|
|
||||||
SetProp(name string, value FileProp)
|
|
||||||
Prop(name string) (FileProp, bool)
|
|
||||||
PropOrDef(name string, valueDef FileProp) FileProp
|
|
||||||
Props() FileProps
|
|
||||||
CopyProps(file File)
|
|
||||||
RemoveProp(name string)
|
|
||||||
|
|
||||||
GoString() string
|
|
||||||
}
|
|
36
file.go
Normal file
36
file.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package goldsmith
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
FileProp any
|
||||||
|
FileProps map[string]FileProp
|
||||||
|
)
|
||||||
|
|
||||||
|
// File represents in-memory or on-disk files in a chain.
|
||||||
|
type File interface {
|
||||||
|
Path() string
|
||||||
|
Dir() string
|
||||||
|
Name() string
|
||||||
|
Ext() string
|
||||||
|
Rename(path string) error
|
||||||
|
|
||||||
|
Size() int64
|
||||||
|
ModTime() time.Time
|
||||||
|
|
||||||
|
Read(data []byte) (int, error)
|
||||||
|
WriteTo(writer io.Writer) (int64, error)
|
||||||
|
Seek(offset int64, whence int) (int64, error)
|
||||||
|
|
||||||
|
SetProp(name string, value FileProp)
|
||||||
|
Prop(name string) (FileProp, bool)
|
||||||
|
PropOrDef(name string, valueDef FileProp) FileProp
|
||||||
|
Props() FileProps
|
||||||
|
CopyProps(file File)
|
||||||
|
RemoveProp(name string)
|
||||||
|
|
||||||
|
GoString() string
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user