disable.go 518 B

12345678910111213141516171819202122232425262728
  1. package osssvr
  2. import (
  3. "io"
  4. "kettle/oss"
  5. )
  6. type disableOss struct{}
  7. func NewDisableOss() oss.IOss {
  8. return &disableOss{}
  9. }
  10. func (self *disableOss) UploadFile(absPath string, key string, conf *oss.UploadConf) (string, error) {
  11. return key, nil
  12. }
  13. func (self *disableOss) Upload(reader io.Reader, len int64, key string, conf *oss.UploadConf) (string, error) {
  14. return key, nil
  15. }
  16. func (self *disableOss) Delete(key string) error {
  17. return nil
  18. }
  19. func (self *disableOss) Exists(key string) bool {
  20. return false
  21. }