fsoss

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEndpoint = "oss-cn-hangzhou.aliyuncs.com"
)

Functions

func New

func New(config *Config) flysystem.IAdapter

Types

type Config

type Config struct {
	CDN    string `json:"cdn" xml:"CDN" yaml:"CDN"`
	Bucket string `json:"bucket" xml:"Bucket" yaml:"Bucket"`
	//https://help.aliyun.com/zh/oss/user-guide/regions-and-endpoints
	Endpoint        string      `json:"endpoint" xml:"Endpoint" yaml:"Endpoint"`
	AccessKeyID     string      `json:"access_key_id" xml:"AccessKeyID" yaml:"AccessKeyID"`
	AccessKeySecret string      `json:"access_key_secret" xml:"AccessKeySecret" yaml:"AccessKeySecret"`
	Config          *oss.Config `json:"config" xml:"Config" yaml:"Config"`
	PathPrefix      string      `json:"path_prefix" xml:"PathPrefix" yaml:"PathPrefix"`
}

func (*Config) New added in v0.3.2

func (c *Config) New() flysystem.IAdapter

type FsOss

type FsOss struct {
	gfs.AbstractAdapter
	Config *Config
	// contains filtered or unexported fields
}

func NewOSS added in v0.0.4

func NewOSS(config *Config) *FsOss

func (*FsOss) Copy

func (f *FsOss) Copy(source, destination string) (bool, error)

func (*FsOss) CreateDirectory

func (f *FsOss) CreateDirectory(dirname string) error

func (*FsOss) Delete

func (f *FsOss) Delete(path string) (int64, error)

func (*FsOss) DiskName

func (f *FsOss) DiskName() string

func (*FsOss) Exists

func (f *FsOss) Exists(path string) (bool, error)

func (*FsOss) GFSAdapter added in v0.3.0

func (f *FsOss) GFSAdapter() gfs.IAdapter

func (*FsOss) MimeType

func (f *FsOss) MimeType(path string) (string, error)

func (*FsOss) Move

func (f *FsOss) Move(source, destination string) (bool, error)

func (*FsOss) Read

func (f *FsOss) Read(path string) ([]byte, error)

func (*FsOss) Size

func (f *FsOss) Size(path string) (int64, error)

func (*FsOss) URL added in v0.1.2

func (f *FsOss) URL(path string) (*url.URL, error)

func (*FsOss) Update

func (f *FsOss) Update(path string, contents []byte) (string, error)

func (*FsOss) UpdateStream

func (f *FsOss) UpdateStream(path, resource string) (string, error)

func (*FsOss) Write

func (f *FsOss) Write(path string, contents []byte) (string, error)

func (*FsOss) WriteReader added in v0.0.2

func (f *FsOss) WriteReader(path string, reader io.Reader) (string, error)

func (*FsOss) WriteStream

func (f *FsOss) WriteStream(path, resource string) (string, error)

Jump to

Keyboard shortcuts

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