filesystem

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Binding = "goravel.filesystem"

Variables

View Source
var ConfigFacade configcontract.Config

Functions

func NewDriver

func NewDriver(config config.Config, disk string) (filesystem.Driver, error)

Types

type Driver

type Driver string
const (
	DriverLocal  Driver = "local"
	DriverCustom Driver = "custom"
)

type File

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

func NewFile

func NewFile(file string) (*File, error)

func NewFileFromRequest

func NewFileFromRequest(fileHeader *multipart.FileHeader) (*File, error)

func (*File) Disk

func (f *File) Disk(disk string) filesystem.File

func (*File) Extension

func (f *File) Extension() (string, error)

func (*File) File

func (f *File) File() string

func (*File) GetClientOriginalExtension

func (f *File) GetClientOriginalExtension() string

func (*File) GetClientOriginalName

func (f *File) GetClientOriginalName() string

func (*File) HashName

func (f *File) HashName(path ...string) string

func (*File) LastModified

func (f *File) LastModified() (time.Time, error)

func (*File) MimeType

func (f *File) MimeType() (string, error)

func (*File) Size

func (f *File) Size() (int64, error)

func (*File) Store

func (f *File) Store(path string) (string, error)

func (*File) StoreAs

func (f *File) StoreAs(path string, name string) (string, error)

type Local

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

func NewLocal

func NewLocal(config config.Config, disk string) (*Local, error)

func (*Local) AllDirectories

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

func (*Local) AllFiles

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

func (*Local) Copy

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

func (*Local) Delete

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

func (*Local) DeleteDirectory

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

func (*Local) Directories

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

func (*Local) Exists

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

func (*Local) Files

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

func (*Local) Get

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

func (*Local) GetBytes

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

func (*Local) LastModified

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

func (*Local) MakeDirectory

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

func (*Local) MimeType

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

func (*Local) Missing

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

func (*Local) Move

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

func (*Local) Path

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

func (*Local) Put

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

func (*Local) PutFile

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

func (*Local) PutFileAs

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

func (*Local) Size

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

func (*Local) TemporaryUrl

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

func (*Local) Url

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

func (*Local) WithContext

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

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

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

func (*ServiceProvider) Register

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

type Storage

type Storage struct {
	filesystem.Driver
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(config config.Config) *Storage

func (*Storage) Disk

func (r *Storage) Disk(disk string) filesystem.Driver

Jump to

Keyboard shortcuts

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