objets

package module
v0.0.0-...-8579eff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2016 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Objets

Objets (/ɔb.ʒɛ/, objects in French) is an object storage server (using a directory as back-end) with a AWS S3 compatible API.

Features

  • Automatic TLS via Let's Encrypt
  • HTTP2 enabled (when using TLS)
  • support public sharing (via the public-read canned ACL)
  • multi-part upload support
  • support both AWS signature v4 and v2
Drawbacks
  • No "one subdomain per bucket"
  • No torrent feature
  • No ACL on bucket
  • Only support private and public-read ACL for objets

QuickStart

$ objets /path/to/config.yaml
Config
data_dir: '/path/where/data/will/be/stored' # optional, defaults to './objets_data'

listen: ':443' # optional, defaults to ':8060', or ':433' in TLS mode

tls_auto: true # optional, defaults to 'false'. Enable/disable auto TLS via Let's Encrypt
tls_domains: # optional. required in TLS mode. List of domains to fetch TLS certificate
  - 'objets.mydomain.com'

access_key_id: 'youracesskeyid'  # required
secret_access_key: 'yoursecretaccesskey' # required
Make it works with s3cmd

To use objets with s3cmd, update ~/.s3cfg.

Local server
access_key = myaccesskey
secret_key = mysecretkey
host_base = localhost:8060
host_bucket = localhost:8060/%(bucket)
use_https = False
TLS mode
access_key = myaccesskey
secret_key = mysecretkey
host_base = objets.yourserver.com
host_bucket = objets.yourserver.com/%(bucket)
use_https = True

License

MIT, see LICENSE

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefautRootPath = "./objets_data"
)

Functions

This section is empty.

Types

type ACL

type ACL struct {
	// contains filtered or unexported fields
}

ACL holds a key => ACL reference

func (*ACL) Close

func (acl *ACL) Close() error

func (*ACL) Get

func (acl *ACL) Get(bucket, key string) (s3layer.CannedACL, error)

func (*ACL) Remove

func (acl *ACL) Remove(bucket, key string) error

func (*ACL) Set

func (acl *ACL) Set(bucket, key string, cacl s3layer.CannedACL) error

type Config

type Config struct {
	// Where objects will be stored
	UserDataDir string `yaml:"data_dir"`

	// Server listen
	UserListen string `yaml:"listen"`

	// TLS related config
	AutoTLS bool     `yaml:"tls_auto"`
	Domains []string `yaml:"tls_domains"`

	// Auth
	AccessKeyID     string `yaml:"access_key_id"`
	SecretAccessKey string `yaml:"secret_access_key"`
}

func (*Config) DataDir

func (c *Config) DataDir() string

func (*Config) Listen

func (c *Config) Listen() string

type Objets

type Objets struct {
	*multipart.MultipartUploadHandler
	// contains filtered or unexported fields
}

func New

func New(confPath string) (*Objets, error)

func (*Objets) Buckets

func (o *Objets) Buckets() ([]*s3layer.Bucket, error)

func (*Objets) Close

func (o *Objets) Close() error

func (*Objets) Cred

func (o *Objets) Cred(accessKeyID string) (string, error)

func (*Objets) DeleteBucket

func (o *Objets) DeleteBucket(bucket string) error

func (*Objets) DeleteObject

func (o *Objets) DeleteObject(bucket, key string) error

func (*Objets) GetObject

func (o *Objets) GetObject(bucket, key string) (io.Reader, s3layer.CannedACL, error)

func (*Objets) ListBucket

func (o *Objets) ListBucket(bucket, prefix string) ([]*s3layer.ListBucketResultContent, []*s3layer.ListBucketResultPrefix, error)

func (*Objets) PutBucket

func (o *Objets) PutBucket(bucket string) error

func (*Objets) PutObject

func (o *Objets) PutObject(bucket, key string, reader io.Reader, acl s3layer.CannedACL) error

func (*Objets) PutObjectAcl

func (o *Objets) PutObjectAcl(bucket, key string, acl s3layer.CannedACL) error

func (*Objets) StatObject

func (o *Objets) StatObject(bucket, key string) (bool, s3layer.CannedACL, error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(objets *Objets) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) Shutdown

func (s *Server) Shutdown()

Directories

Path Synopsis
cmd
objets command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址