Versions in this module Expand all Collapse all v9 v9.1.0 Jan 26, 2024 v9.0.0 Oct 27, 2023 Changes in this version + var ErrEmptyResource = errors.New("resource has no content") + var ErrFileNil = errors.New("no file provided") + var ErrResourceAlreadyExists = errors.New("resource already exists") + var ErrResourceInvalidFormat = errors.New("invalid resource format") + var ErrResourceNotFound = errors.New("resource not found") + var ErrSourceFile = errors.New("source is a file, should be a folder") + var ErrSourceFolderEmpty = errors.New("source folder is empty") + var ErrSourceFolderNotFound = errors.New("source folder not found") + func ReadFile(ctx context.Context, resource Resource, path string, fn ReadFileFunc) ([]byte, error) + func UploadDir(ctx context.Context, resource Resource, src string, fn WalkDirFunc) error + func UploadZip(ctx context.Context, resource Resource, file *os.File, fn WalkDirFunc) error + func WalkDir(ctx context.Context, src string, walkFunc WalkDirFunc) error + type ReadFileFunc func(ctx context.Context, resource Resource, path string) (io.ReadCloser, error) + type Resource interface + GetOwner func() string + GetUUID func() string + GetVersion func() uint64 + func NewResource(uuid string, owner string, version uint64) Resource + type Storage interface + Download func(ctx context.Context, resource Resource) (string, error) + GetFile func(ctx context.Context, resource Resource, path string) ([]byte, error) + UploadDir func(ctx context.Context, resource Resource, source string) error + UploadZip func(ctx context.Context, resource Resource, file *os.File) error + func NewGCS(client *storage.Client, bucket string, pk []byte, accessID string) Storage + func NewS3v1(client *s3api.S3, uploader *s3manager.Uploader, bucket string) Storage + func NewS3v2(client *s3api.Client, bucket string) Storage + type WalkDirFunc func(ctx context.Context, path string, body io.Reader) error Other modules containing this package github.com/gazebo-web/gz-go/v10 github.com/gazebo-web/gz-go/v7 github.com/gazebo-web/gz-go/v8