 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- type BucketResponse
- type CopyObjectRequest
- type CopyObjectResponse
- type CreateBucketRequest
- type CreateBucketResponse
- type DeleteBucketResponse
- type DeleteObjectsRequest
- type DeleteObjectsResponse
- type FileOptions
- type ListObjectsQuery
- type MoveObjectRequest
- type MoveObjectResponse
- type ObjectMetadata
- type ObjectResponse
- type StorageAPI
- func (s *StorageAPI) CopyObject(ctx context.Context, bucketId, srcPath, dstPath string) (CopyObjectResponse, error)
- func (s *StorageAPI) CreateBucket(ctx context.Context, body CreateBucketRequest) (CreateBucketResponse, error)
- func (s *StorageAPI) DeleteBucket(ctx context.Context, bucketId string) (DeleteBucketResponse, error)
- func (s *StorageAPI) DeleteObjects(ctx context.Context, bucket string, prefixes []string) ([]DeleteObjectsResponse, error)
- func (s *StorageAPI) DownloadObject(ctx context.Context, remotePath, localPath string, fsys afero.Fs) error
- func (s *StorageAPI) DownloadObjectStream(ctx context.Context, remotePath string, localFile io.Writer) error
- func (s *StorageAPI) ListBuckets(ctx context.Context) ([]BucketResponse, error)
- func (s *StorageAPI) ListObjects(ctx context.Context, bucket, prefix string, page int) ([]ObjectResponse, error)
- func (s *StorageAPI) MoveObject(ctx context.Context, bucketId, srcPath, dstPath string) (MoveObjectResponse, error)
- func (s *StorageAPI) UpdateBucket(ctx context.Context, body UpdateBucketRequest) (UpdateBucketResponse, error)
- func (s *StorageAPI) UploadObject(ctx context.Context, remotePath, localPath string, fsys afero.Fs, ...) error
- func (s *StorageAPI) UploadObjectStream(ctx context.Context, remotePath string, localFile io.Reader, fo FileOptions) error
- func (s *StorageAPI) UpsertBuckets(ctx context.Context, bucketConfig config.BucketConfig, ...) error
- func (s *StorageAPI) UpsertObjects(ctx context.Context, bucketConfig config.BucketConfig, fsys fs.FS, ...) error
 
- type UpdateBucketRequest
- type UpdateBucketResponse
- type UploadOptions
Constants ¶
      View Source
      
  
const PAGE_LIMIT = 100
    Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketResponse ¶
type BucketResponse struct {
	Id               string   `json:"id"`                 // "test"
	Name             string   `json:"name"`               // "test"
	Owner            string   `json:"owner"`              // ""
	Public           bool     `json:"public"`             // true
	FileSizeLimit    *int     `json:"file_size_limit"`    // null
	AllowedMimeTypes []string `json:"allowed_mime_types"` // null
	CreatedAt        string   `json:"created_at"`         // "2023-10-13T17:48:58.491Z"
	UpdatedAt        string   `json:"updated_at"`         // "2023-10-13T17:48:58.491Z"
}
    type CopyObjectRequest ¶
type CopyObjectRequest = MoveObjectRequest
type CopyObjectResponse ¶
type CopyObjectResponse struct {
	Key string `json:"key"`
}
    type CreateBucketRequest ¶
type CreateBucketRequest struct {
	Name             string   `json:"name"`                         // "string",
	Id               string   `json:"id,omitempty"`                 // "string",
	Public           *bool    `json:"public,omitempty"`             // false,
	FileSizeLimit    int64    `json:"file_size_limit,omitempty"`    // 0,
	AllowedMimeTypes []string `json:"allowed_mime_types,omitempty"` // ["string"]
}
    type CreateBucketResponse ¶
type CreateBucketResponse struct {
	Name string `json:"name"`
}
    type DeleteBucketResponse ¶
type DeleteBucketResponse struct {
	Message string `json:"message"`
}
    type DeleteObjectsRequest ¶
type DeleteObjectsRequest struct {
	Prefixes []string `json:"prefixes"`
}
    type DeleteObjectsResponse ¶
type DeleteObjectsResponse struct {
	BucketId       string         `json:"bucket_id"`        // "private"
	Owner          string         `json:"owner"`            // ""
	OwnerId        string         `json:"owner_id"`         // ""
	Version        string         `json:"version"`          // "cf5c5c53-ee73-4806-84e3-7d92c954b436"
	Name           string         `json:"name"`             // "abstract.pdf"
	Id             string         `json:"id"`               // "9b7f9f48-17a6-4ca8-b14a-39b0205a63e9"
	UpdatedAt      string         `json:"updated_at"`       // "2023-10-13T18:08:22.068Z"
	CreatedAt      string         `json:"created_at"`       // "2023-10-13T18:08:22.068Z"
	LastAccessedAt string         `json:"last_accessed_at"` // "2023-10-13T18:08:22.068Z"
	Metadata       ObjectMetadata `json:"metadata"`         // null
}
    type FileOptions ¶
func ParseFileOptions ¶
func ParseFileOptions(f fs.File, opts ...func(*FileOptions)) (*FileOptions, error)
type ListObjectsQuery ¶
type MoveObjectRequest ¶
type MoveObjectResponse ¶
type MoveObjectResponse = DeleteBucketResponse
type ObjectMetadata ¶
type ObjectMetadata struct {
	ETag           string `json:"eTag"`           // "\"887ea9be3c68e6f2fca7fd2d7c77d8fe\""
	Size           int    `json:"size"`           // 82702
	Mimetype       string `json:"mimetype"`       // "application/pdf"
	CacheControl   string `json:"cacheControl"`   // "max-age=3600"
	LastModified   string `json:"lastModified"`   // "2023-10-13T18:08:22.000Z"
	ContentLength  int    `json:"contentLength"`  // 82702
	HttpStatusCode int    `json:"httpStatusCode"` // 200
}
    type ObjectResponse ¶
type ObjectResponse struct {
	Name           string          `json:"name"`             // "abstract.pdf"
	Id             *string         `json:"id"`               // "9b7f9f48-17a6-4ca8-b14a-39b0205a63e9"
	UpdatedAt      *string         `json:"updated_at"`       // "2023-10-13T18:08:22.068Z"
	CreatedAt      *string         `json:"created_at"`       // "2023-10-13T18:08:22.068Z"
	LastAccessedAt *string         `json:"last_accessed_at"` // "2023-10-13T18:08:22.068Z"
	Metadata       *ObjectMetadata `json:"metadata"`         // null
}
    type StorageAPI ¶
func (*StorageAPI) CopyObject ¶
func (s *StorageAPI) CopyObject(ctx context.Context, bucketId, srcPath, dstPath string) (CopyObjectResponse, error)
func (*StorageAPI) CreateBucket ¶
func (s *StorageAPI) CreateBucket(ctx context.Context, body CreateBucketRequest) (CreateBucketResponse, error)
func (*StorageAPI) DeleteBucket ¶
func (s *StorageAPI) DeleteBucket(ctx context.Context, bucketId string) (DeleteBucketResponse, error)
func (*StorageAPI) DeleteObjects ¶
func (s *StorageAPI) DeleteObjects(ctx context.Context, bucket string, prefixes []string) ([]DeleteObjectsResponse, error)
func (*StorageAPI) DownloadObject ¶
func (*StorageAPI) DownloadObjectStream ¶ added in v1.188.1
func (*StorageAPI) ListBuckets ¶
func (s *StorageAPI) ListBuckets(ctx context.Context) ([]BucketResponse, error)
func (*StorageAPI) ListObjects ¶
func (s *StorageAPI) ListObjects(ctx context.Context, bucket, prefix string, page int) ([]ObjectResponse, error)
func (*StorageAPI) MoveObject ¶
func (s *StorageAPI) MoveObject(ctx context.Context, bucketId, srcPath, dstPath string) (MoveObjectResponse, error)
func (*StorageAPI) UpdateBucket ¶ added in v1.180.0
func (s *StorageAPI) UpdateBucket(ctx context.Context, body UpdateBucketRequest) (UpdateBucketResponse, error)
func (*StorageAPI) UploadObject ¶
func (s *StorageAPI) UploadObject(ctx context.Context, remotePath, localPath string, fsys afero.Fs, opts ...func(*FileOptions)) error
func (*StorageAPI) UploadObjectStream ¶ added in v1.188.1
func (s *StorageAPI) UploadObjectStream(ctx context.Context, remotePath string, localFile io.Reader, fo FileOptions) error
func (*StorageAPI) UpsertBuckets ¶ added in v1.186.0
func (s *StorageAPI) UpsertBuckets(ctx context.Context, bucketConfig config.BucketConfig, filter ...func(string) bool) error
func (*StorageAPI) UpsertObjects ¶ added in v1.188.1
func (s *StorageAPI) UpsertObjects(ctx context.Context, bucketConfig config.BucketConfig, fsys fs.FS, opts ...func(*UploadOptions)) error
type UpdateBucketRequest ¶ added in v1.180.0
type UpdateBucketResponse ¶ added in v1.180.0
type UpdateBucketResponse struct {
	Message string `json:"message"`
}
    type UploadOptions ¶ added in v1.188.1
 Click to show internal directories. 
   Click to hide internal directories.