You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

helper.go 843B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package storage
  4. import (
  5. "fmt"
  6. "io"
  7. "net/url"
  8. "os"
  9. )
  10. var uninitializedStorage = discardStorage("uninitialized storage")
  11. type discardStorage string
  12. func (s discardStorage) Open(_ string) (Object, error) {
  13. return nil, fmt.Errorf("%s", s)
  14. }
  15. func (s discardStorage) Save(_ string, _ io.Reader, _ int64) (int64, error) {
  16. return 0, fmt.Errorf("%s", s)
  17. }
  18. func (s discardStorage) Stat(_ string) (os.FileInfo, error) {
  19. return nil, fmt.Errorf("%s", s)
  20. }
  21. func (s discardStorage) Delete(_ string) error {
  22. return fmt.Errorf("%s", s)
  23. }
  24. func (s discardStorage) URL(_, _ string) (*url.URL, error) {
  25. return nil, fmt.Errorf("%s", s)
  26. }
  27. func (s discardStorage) IterateObjects(_ string, _ func(string, Object) error) error {
  28. return fmt.Errorf("%s", s)
  29. }