2020-10-13 09:28:34 +05:30
|
|
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
2022-11-27 23:50:29 +05:30
|
|
|
// SPDX-License-Identifier: MIT
|
2020-10-13 09:28:34 +05:30
|
|
|
|
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
2022-11-30 19:09:02 +05:30
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"net/url"
|
|
|
|
"os"
|
2020-10-13 09:28:34 +05:30
|
|
|
)
|
|
|
|
|
2024-06-05 02:50:20 +05:30
|
|
|
var UninitializedStorage = discardStorage("uninitialized storage")
|
2022-11-30 19:09:02 +05:30
|
|
|
|
|
|
|
type discardStorage string
|
|
|
|
|
|
|
|
func (s discardStorage) Open(_ string) (Object, error) {
|
|
|
|
return nil, fmt.Errorf("%s", s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s discardStorage) Save(_ string, _ io.Reader, _ int64) (int64, error) {
|
|
|
|
return 0, fmt.Errorf("%s", s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s discardStorage) Stat(_ string) (os.FileInfo, error) {
|
|
|
|
return nil, fmt.Errorf("%s", s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s discardStorage) Delete(_ string) error {
|
|
|
|
return fmt.Errorf("%s", s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s discardStorage) URL(_, _ string) (*url.URL, error) {
|
|
|
|
return nil, fmt.Errorf("%s", s)
|
|
|
|
}
|
|
|
|
|
2023-03-13 15:53:51 +05:30
|
|
|
func (s discardStorage) IterateObjects(_ string, _ func(string, Object) error) error {
|
2022-11-30 19:09:02 +05:30
|
|
|
return fmt.Errorf("%s", s)
|
|
|
|
}
|