mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-11 06:47:29 -06:00
fileserver working
This commit is contained in:
parent
7ab9e78b44
commit
2fa5519d55
18 changed files with 480 additions and 133 deletions
|
|
@ -15,13 +15,13 @@ import (
|
|||
func NewInMem(c *config.Config, log *logrus.Logger) (Storage, error) {
|
||||
return &inMemStorage{
|
||||
stored: make(map[string][]byte),
|
||||
log: log,
|
||||
log: log,
|
||||
}, nil
|
||||
}
|
||||
|
||||
type inMemStorage struct {
|
||||
stored map[string][]byte
|
||||
log *logrus.Logger
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
func (s *inMemStorage) StoreFileAt(path string, data []byte) error {
|
||||
|
|
@ -41,7 +41,7 @@ func (s *inMemStorage) RetrieveFileFrom(path string) ([]byte, error) {
|
|||
return d, nil
|
||||
}
|
||||
|
||||
func (s *inMemStorage)ListKeys() ([]string, error) {
|
||||
func (s *inMemStorage) ListKeys() ([]string, error) {
|
||||
keys := []string{}
|
||||
for k := range s.stored {
|
||||
keys = append(keys, k)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue