cos

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

COS

A COS disk driver for facades.Storage() of Goravel.

Version

goravel/cos 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/cos

Or check the setup file to install the package manually.

Testing

Run command below to run test:

TENCENT_ACCESS_KEY_ID= TENCENT_ACCESS_KEY_SECRET= TENCENT_URL= go test ./...

Documentation

Index

Constants

View Source
const Binding = "goravel.cos"

Variables

Functions

This section is empty.

Types

type Cos

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

func NewCos

func NewCos(ctx context.Context, config config.Config, disk string) (*Cos, error)

func (*Cos) AllDirectories

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

func (*Cos) AllFiles

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

func (*Cos) Copy

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

func (*Cos) Delete

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

func (*Cos) DeleteDirectory

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

func (*Cos) Directories

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

func (*Cos) Exists

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

func (*Cos) Files

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

func (*Cos) Get

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

func (*Cos) GetBytes added in v1.1.1

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

func (*Cos) LastModified

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

func (*Cos) MakeDirectory

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

func (*Cos) MimeType

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

func (*Cos) Missing

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

func (*Cos) Move

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

func (*Cos) Path

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

func (*Cos) Put

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

func (*Cos) PutFile

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

func (*Cos) PutFileAs

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

func (*Cos) Size

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

func (*Cos) TemporaryUrl

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

func (*Cos) Url

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

func (*Cos) WithContext

func (r *Cos) 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