mirror of
				https://github.com/datarhei/core.git
				synced 2025-11-01 03:42:51 +08:00 
			
		
		
		
	 a692f88b69
			
		
	
	a692f88b69
	
	
	
		
			
			Works similar to the GET endpoint. It has the same query parameter (without "sort" and "order"). A glob pattern has to be provided. To select all files, use the glob pattern "/**".
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package fs
 | |
| 
 | |
| import (
 | |
| 	"io"
 | |
| 	"os"
 | |
| )
 | |
| 
 | |
| type readOnlyFilesystem struct {
 | |
| 	Filesystem
 | |
| }
 | |
| 
 | |
| func NewReadOnlyFilesystem(fs Filesystem) (Filesystem, error) {
 | |
| 	r := &readOnlyFilesystem{
 | |
| 		Filesystem: fs,
 | |
| 	}
 | |
| 
 | |
| 	return r, nil
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) Symlink(oldname, newname string) error {
 | |
| 	return os.ErrPermission
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) WriteFileReader(path string, rd io.Reader) (int64, bool, error) {
 | |
| 	return -1, false, os.ErrPermission
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) WriteFile(path string, data []byte) (int64, bool, error) {
 | |
| 	return -1, false, os.ErrPermission
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) WriteFileSafe(path string, data []byte) (int64, bool, error) {
 | |
| 	return -1, false, os.ErrPermission
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) MkdirAll(path string, perm os.FileMode) error {
 | |
| 	return os.ErrPermission
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) Remove(path string) int64 {
 | |
| 	return -1
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) RemoveList(path string, options ListOptions) ([]string, int64) {
 | |
| 	return nil, 0
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) Purge(size int64) int64 {
 | |
| 	return 0
 | |
| }
 | |
| 
 | |
| func (r *readOnlyFilesystem) Resize(size int64) error {
 | |
| 	return os.ErrPermission
 | |
| }
 |