io_util.go 437 B

12345678910111213141516171819202122232425
  1. package services
  2. import (
  3. "io/ioutil"
  4. "os"
  5. )
  6. type IoUtilImp struct {
  7. }
  8. func (i IoUtilImp) Stat(path string) (os.FileInfo, error) {
  9. return os.Stat(path)
  10. }
  11. func (i IoUtilImp) RemoveAll(path string) error {
  12. return os.RemoveAll(path)
  13. }
  14. func (i IoUtilImp) ReadDir(path string) ([]os.FileInfo, error) {
  15. return ioutil.ReadDir(path)
  16. }
  17. func (i IoUtilImp) ReadFile(filename string) ([]byte, error) {
  18. return ioutil.ReadFile(filename)
  19. }