mirror of
https://github.com/criyle/go-judge.git
synced 2025-11-04 14:50:02 +08:00
22 lines
356 B
Go
22 lines
356 B
Go
package file
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
)
|
|
|
|
// Opener opens the file in readonly mode
|
|
// caller should close afterwards
|
|
type Opener interface {
|
|
Open() (*os.File, error)
|
|
}
|
|
|
|
// File defines file name with its content
|
|
// file could on file system or memory
|
|
type File interface {
|
|
Opener
|
|
Content() ([]byte, error)
|
|
Name() string
|
|
Reader() (io.ReadCloser, error)
|
|
}
|