Coder Social home page Coder Social logo

gost's Issues

Remove global service

Your S3 interface currently implements a global service that's used for the file system, which is not ideal when working with multiple buckets in different regions as the creation of subsequent filesystems will error as it will reuse the service created in the original file system.

I propose that the SetService function be removed as well as the global service in s3/s3.go

Recursively directory creation not work

Code:

var Directory gost.Directory = initDirectory()

func initDirectory() gost.Directory {
        if dir, err := local.New(local.Config{
		BasePath: "/path/to/public",
	}); err != nil {
		log.Fatal(err.Error())
	} else {
		return dir
	}

	return nil
}

func MakeTestFile() {
	newFile := Directory.File("test/test/test.txt")

	if !newFile.Exists() {
		log.Println("File does not exist")
		if err := newFile.Directory().Create(); err != nil {
			log.Fatal(err.Error())
		}
	}

	if n, err := newFile.Write([]byte("Test txt")); err != nil {
		log.Fatal(err.Error())
	} else if n == 0 {
		log.Println("Null bytes writed")
	}
}

Problem:

When I try to create a folder in a subdirectory higher than one level, I get the error on newFile.Directory().Create():

File does not exist
Fatal: mkdir /path/to/public/uploads/test/test: no such file or directory

Because there is no test folder in the uploads folder. What can I do in such a situation? If I create folders using os, I cannot use S3 in production

Very nice work!

how can i connect to this S3 api? if it's not available, can u do the api for it?

e.g. would like to use it as a s3 alternative using my server's local filesystem instead of s3 so need to connection from external app to use this one.

how can i get this done? pls help. will buy u a coffee if it's already done

Permissions on local directory

I can't access local directories created by the library, it seems as though the directories are given the permission 644 instead of 777.

Compatibility with webdav.Filesystem interface

Hello,

Thanks for your work.

What would have been even greater is to keep the compatibility with the existing File/Filesystem interfaces to provide an abstraction layer that can be used with existing libraries (webdav.FileSystem and webdav.File for example).

An other point : using minio-go instead of aws sdk would enable use of s3 compatible services.

Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.