fs

package
v0.0.0-...-a0d1ad3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 7 Imported by: 0

README

HVX FILE SYSTEM

Documentation

Index

Constants

View Source
const (
	MinioPublicAvatarBucketPolicy = `` /* 397-byte string literal not displayed */
	MinioPublicAttachBucketPolicy = `` /* 397-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	// Create a storage bucket and use the provider to distinguish the fs server.
	Create() error
}

type Files

type Files interface {
	// Put method and use the provider to distinguish the fs server.
	Put() (string, error)

	// Delete objects from the object store by filename.
	Delete() error
}

type Fs

type Fs struct {
	Provider   string
	BucketName string

	FileName    string
	ContentType string
	FileBuffer  io.Reader
	FileSize    int64
}

func NewBucket

func NewBucket(provider string, bucketName string) *Fs

func NewFsDelete

func NewFsDelete(provider string, bucketName string, fileName string) *Fs

func NewFsPut

func NewFsPut(provider string, bucketName string, fileName string, contentType string, buffer io.Reader, fileSize int64) *Fs

func (*Fs) Create

func (f *Fs) Create() error

func (*Fs) Delete

func (f *Fs) Delete() error

func (*Fs) Put

func (f *Fs) Put() (string, error)

type Minio

type Minio struct {
	Region string
	Ctx    context.Context
	Client *minio.Client
	// contains filtered or unexported fields
}

func NewDefaultMinio

func NewDefaultMinio() *Minio

func (*Minio) Dial

func (x *Minio) Dial() (*Minio, error)

Dial the server connected to Minio returns the client with the context.

func (*Minio) GetBucketPolicy

func (x *Minio) GetBucketPolicy(name string) (string, error)

func (*Minio) ListBuckets

func (x *Minio) ListBuckets() error

func (*Minio) MakeBucket

func (x *Minio) MakeBucket(name, policy string) error

type MinioBucket

type MinioBucket interface {
	MakeBucket(name, policy string) error
	ListBuckets() error
	GetBucketPolicy(name string) (string, error)
}

type MinioFile

type MinioFile interface {
	Put() (*minio.UploadInfo, error)
	Remove(o string)
}

type MinioFiles

type MinioFiles struct {
	Ctx         context.Context
	Client      *minio.Client
	BucketName  string
	ObjectName  string
	ContentType string

	Buffer io.Reader
	Size   int64
}

func NewMinioFiles

func NewMinioFiles(client *minio.Client, ctx context.Context, bucketName, objectName, contentType string, buffer io.Reader, size int64) *MinioFiles

func NewMinioRemoveFile

func NewMinioRemoveFile(client *minio.Client, ctx context.Context, bucket, name string) *MinioFiles

func (*MinioFiles) Put

func (x *MinioFiles) Put() (*minio.UploadInfo, error)

func (*MinioFiles) Remove

func (x *MinioFiles) Remove() error

Jump to

Keyboard shortcuts

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