ofs

package module
v0.0.0-...-974551f Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 3 Imported by: 1

README

OFS (Object File Storage)

OFS aims to provide a common interface to operate files with any kinds of storages, like cloud storages, FTP, file system etc

Usage

Currently, MayCMF OFS provides support for file system and S3. You can easily implement your own storage strategies by implementing the interface.

Methods

... CCOMMING SOON ...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Object

type Object struct {
	Path             string
	Name             string
	LastModified     *time.Time
	StorageInterface StorageInterface
}

Object content object

func (Object) Get

func (object Object) Get() (*os.File, error)

Get retrieve object's content

type StorageInterface

type StorageInterface interface {
	Get(path string) (*os.File, error)
	GetStream(path string) (io.ReadCloser, error)
	Put(path string, reader io.Reader) (*Object, error)
	Delete(path string) error
	List(path string) ([]*Object, error)
	GetURL(path string) (string, error)
	GetEndpoint() string
}

StorageInterface define common API to operate storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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