From 88d8b292cd0a7ecdf3facdc665d40b505d5d1a6a Mon Sep 17 00:00:00 2001 From: MrMelon Date: Fri, 24 Dec 2021 01:14:18 +0000 Subject: [PATCH] First commit --- .idea/.gitignore | 8 ++++++++ .idea/discord.xml | 7 +++++++ .idea/modules.xml | 8 ++++++++ .idea/neutered-filesystem.iml | 9 +++++++++ go.mod | 3 +++ neutered-filesystem.go | 26 ++++++++++++++++++++++++++ 6 files changed, 61 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/discord.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/neutered-filesystem.iml create mode 100644 go.mod create mode 100644 neutered-filesystem.go diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..d8e9561 --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6643a66 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/neutered-filesystem.iml b/.idea/neutered-filesystem.iml new file mode 100644 index 0000000..5e764c4 --- /dev/null +++ b/.idea/neutered-filesystem.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ba52623 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module tea.melonie54.xyz/sean/neutered-filesystem + +go 1.17 diff --git a/neutered-filesystem.go b/neutered-filesystem.go new file mode 100644 index 0000000..95fc545 --- /dev/null +++ b/neutered-filesystem.go @@ -0,0 +1,26 @@ +package neutered_filesystem + +import ( + "net/http" + "os" +) + +type NeuteredFileSystem struct { + fs http.FileSystem +} + +func (fs NeuteredFileSystem) Open(name string) (http.File, error) { + f, err := fs.fs.Open(name) + if err != nil { + return nil, err + } + return neuteredReaddirFile{f}, nil +} + +type neuteredReaddirFile struct { + http.File +} + +func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) { + return nil, nil +}