oss

package module
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 20 Imported by: 0

README

OSS

An OSS disk driver for facades.Storage() of Goravel.

Version

goravel/oss goravel/framework
v1.17.x v1.17.x
v1.4.* v1.16.*
v1.3.* v1.15.*
v1.2.* v1.14.*
v1.1.* v1.13.*
v1.0.* v1.12.*

Install

Run the command below in your project to install the package automatically:

./artisan package:install github.com/goravel/oss

Or check the setup file to install the package manually.

Testing

Run command below to run test:

ALIYUN_ACCESS_KEY_ID= ALIYUN_ACCESS_KEY_SECRET= ALIYUN_BUCKET= ALIYUN_URL= ALIYUN_ENDPOINT= go test ./...

Documentation

Index

Constants

View Source
const Binding = "goravel.oss"
View Source
const MaxFileNum = 1000

Variables

Functions

This section is empty.

Types

type Oss

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

func NewOss

func NewOss(ctx context.Context, config config.Config, disk string) (*Oss, error)

func (*Oss) AllDirectories

func (r *Oss) AllDirectories(path string) ([]string, error)

func (*Oss) AllFiles

func (r *Oss) AllFiles(path string) ([]string, error)

func (*Oss) Copy

func (r *Oss) Copy(originFile, targetFile string) error

func (*Oss) Delete

func (r *Oss) Delete(files ...string) error

func (*Oss) DeleteDirectory

func (r *Oss) DeleteDirectory(directory string) error

func (*Oss) Directories

func (r *Oss) Directories(path string) ([]string, error)

func (*Oss) Exists

func (r *Oss) Exists(file string) bool

func (*Oss) Files

func (r *Oss) Files(path string) ([]string, error)

func (*Oss) Get

func (r *Oss) Get(file string) (string, error)

func (*Oss) GetBytes added in v1.1.1

func (r *Oss) GetBytes(file string) ([]byte, error)

func (*Oss) LastModified

func (r *Oss) LastModified(file string) (time.Time, error)

func (*Oss) MakeDirectory

func (r *Oss) MakeDirectory(directory string) error

func (*Oss) MimeType

func (r *Oss) MimeType(file string) (string, error)

func (*Oss) Missing

func (r *Oss) Missing(file string) bool

func (*Oss) Move

func (r *Oss) Move(oldFile, newFile string) error

func (*Oss) Path

func (r *Oss) Path(file string) string

func (*Oss) Put

func (r *Oss) Put(file string, content string) error

func (*Oss) PutFile

func (r *Oss) PutFile(filePath string, source filesystem.File) (string, error)

func (*Oss) PutFileAs

func (r *Oss) PutFileAs(filePath string, source filesystem.File, name string) (string, error)

func (*Oss) Size

func (r *Oss) Size(file string) (int64, error)

func (*Oss) TemporaryUrl

func (r *Oss) TemporaryUrl(file string, t time.Time) (string, error)

func (*Oss) Url

func (r *Oss) Url(file string) string

func (*Oss) WithContext

func (r *Oss) WithContext(ctx context.Context) filesystem.Driver

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (r *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (r *ServiceProvider) Register(app foundation.Application)

func (*ServiceProvider) Relationship added in v1.4.0

func (r *ServiceProvider) Relationship() binding.Relationship

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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