storage

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchDeleteObjectsData

type BatchDeleteObjectsData struct {
	Deleted []string `json:"deleted"`
	Failed  []string `json:"failed"`
}

BatchDeleteObjectsData represents the data for batch delete objects response

type BatchDeleteObjectsRequest

type BatchDeleteObjectsRequest struct {
	Paths []string `json:"paths"`
}

BatchDeleteObjectsRequest represents a request to batch delete objects

type BatchDeleteObjectsResponse

type BatchDeleteObjectsResponse struct {
	Deleted []string `json:"deleted"`
	Failed  []string `json:"failed"`
}

BatchDeleteObjectsResponse represents the response for batch deleting objects

type CreateDirectoryRequest

type CreateDirectoryRequest struct {
	Prefix string `json:"prefix"`
}

CreateDirectoryRequest represents a request to create a directory

type CreateDirectoryRequestAlias

type CreateDirectoryRequestAlias = CreateDirectoryRequest

Type aliases for backward compatibility with types.CreateDirectoryRequest Deprecated: Use storage.CreateDirectoryRequest directly.

type CreateDirectoryResponse

type CreateDirectoryResponse struct {
	Prefix string `json:"prefix"`
}

CreateDirectoryResponse represents the response for creating a directory

type CreateDirectoryResponseAlias

type CreateDirectoryResponseAlias = CreateDirectoryResponse

Type aliases for backward compatibility with types.CreateDirectoryResponse Deprecated: Use storage.CreateDirectoryResponse directly.

type DeleteObjectRequest

type DeleteObjectRequest struct {
	Path string `form:"path"`
}

DeleteObjectRequest represents a request to delete an object

type DeleteObjectRequestAlias

type DeleteObjectRequestAlias = DeleteObjectRequest

Type aliases for backward compatibility with types.DeleteObjectRequest Deprecated: Use storage.DeleteObjectRequest directly.

type DeleteObjectResponse

type DeleteObjectResponse struct {
	Path string `json:"path"`
}

DeleteObjectResponse represents the response for deleting an object

type DeleteObjectResponseAlias

type DeleteObjectResponseAlias = DeleteObjectResponse

Type aliases for backward compatibility with types.DeleteObjectResponse Deprecated: Use storage.DeleteObjectResponse directly.

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) BatchDeleteObjects

func (h *Handler) BatchDeleteObjects(c *gin.Context)

BatchDeleteObjects handles the request to batch delete objects

func (*Handler) CreateDirectory

func (h *Handler) CreateDirectory(c *gin.Context)

CreateDirectory handles the request to create a directory

func (*Handler) DeleteObject

func (h *Handler) DeleteObject(c *gin.Context)

DeleteObject handles the request to delete an object

func (*Handler) ListObjects

func (h *Handler) ListObjects(c *gin.Context)

ListObjects handles the request to list objects

func (*Handler) RenameDirectory

func (h *Handler) RenameDirectory(c *gin.Context)

RenameDirectory handles the request to rename a directory

func (*Handler) SignedURL

func (h *Handler) SignedURL(c *gin.Context)

SignedURL alias for route compatibility

func (*Handler) SignedUrl

func (h *Handler) SignedUrl(c *gin.Context)

SignedUrl handles the request to get a signed URL

func (*Handler) UploadObject

func (h *Handler) UploadObject(c *gin.Context)

UploadObject handles the request to upload an object

type ListObjectsRequest

type ListObjectsRequest struct {
	Prefix          string `form:"prefix"`
	Delimiter       string `form:"delimiter"`
	Marker          string `form:"marker"`
	MaxKeys         int    `form:"maxKeys"`
	Limit           int    `form:"limit"`
	StorageClassURL string `form:"storageClassUrl"`
}

ListObjectsRequest represents a request to list objects

type ListObjectsRequestAlias

type ListObjectsRequestAlias = ListObjectsRequest

Type aliases for backward compatibility with types.ListObjectsRequest Deprecated: Use storage.ListObjectsRequest directly.

type ListObjectsResponse

type ListObjectsResponse struct {
	Objects     []ObjectInfo `json:"objects"`
	Prefixes    []string     `json:"prefixes"`
	IsTruncated bool         `json:"is_truncated"`
	NextMarker  string       `json:"next_marker"`
}

ListObjectsResponse represents the response for listing objects

type ListObjectsResponseAlias

type ListObjectsResponseAlias = ListObjectsResponse

Type aliases for backward compatibility with types.ListObjectsResponse Deprecated: Use storage.ListObjectsResponse directly.

type ObjectInfo

type ObjectInfo struct {
	Key          string `json:"key"`
	Size         int64  `json:"size"`
	LastModified string `json:"last_modified"`
	ETag         string `json:"etag"`
	StorageClass string `json:"storage_class"`
}

ObjectInfo represents information about a storage object

type ObjectInfoAlias

type ObjectInfoAlias = ObjectInfo

Type aliases for backward compatibility with types.ObjectInfo Deprecated: Use storage.ObjectInfo directly.

type ObjectsData

type ObjectsData = ListObjectsResponse

ObjectsData represents the data returned when listing objects

type ObjectsDataAlias

type ObjectsDataAlias = ObjectsData

Type aliases for backward compatibility with types.ObjectsData Deprecated: Use storage.ObjectsData directly.

type RenameDirectoryRequest

type RenameDirectoryRequest struct {
	OldPrefix string `json:"oldPrefix"`
	NewPrefix string `json:"newPrefix"`
}

RenameDirectoryRequest represents a request to rename a directory

type RenameDirectoryResponse

type RenameDirectoryResponse struct {
	OldPrefix string `json:"oldPrefix"`
	NewPrefix string `json:"newPrefix"`
}

RenameDirectoryResponse represents the response for renaming a directory

type Service

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

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) BatchDeleteObjects

BatchDeleteObjects batch deletes objects from storage

func (*Service) CreateDirectory

func (s *Service) CreateDirectory(ctx context.Context, req *CreateDirectoryRequest) (*CreateDirectoryResponse, error)

CreateDirectory creates a directory in storage

func (*Service) DeleteObject

func (s *Service) DeleteObject(ctx context.Context, req *DeleteObjectRequest) (*DeleteObjectResponse, error)

DeleteObject deletes an object from storage

func (*Service) ListObjects

func (s *Service) ListObjects(ctx context.Context, req *ListObjectsRequest) (*ListObjectsResponse, error)

ListObjects lists objects in the storage

func (*Service) RenameDirectory

func (s *Service) RenameDirectory(ctx context.Context, req *RenameDirectoryRequest) (*RenameDirectoryResponse, error)

RenameDirectory renames a directory in storage

func (*Service) SignedUrl

func (s *Service) SignedUrl(ctx context.Context, req *SignedUrlRequest) (*SignedUrlResponse, error)

SignedUrl generates a signed URL for object access

func (*Service) UploadObject

func (s *Service) UploadObject(ctx context.Context, req *UploadObjectRequest) (*UploadObjectResponse, error)

UploadObject uploads an object to storage

type SignedUrlRequest

type SignedUrlRequest struct {
	Path   string `form:"path"`
	Expire int    `form:"expire"`
}

SignedUrlRequest represents a request to get a signed URL

type SignedUrlRequestAlias

type SignedUrlRequestAlias = SignedUrlRequest

Type aliases for backward compatibility with types.SignedUrlRequest Deprecated: Use storage.SignedUrlRequest directly.

type SignedUrlResponse

type SignedUrlResponse struct {
	URL string `json:"url"`
}

SignedUrlResponse represents the response for getting a signed URL

type SignedUrlResponseAlias

type SignedUrlResponseAlias = SignedUrlResponse

Type aliases for backward compatibility with types.SignedUrlResponse Deprecated: Use storage.SignedUrlResponse directly.

type UploadObjectData

type UploadObjectData struct {
	Path string `json:"path"`
}

UploadObjectData represents the data for upload object response

type UploadObjectDataAlias

type UploadObjectDataAlias = UploadObjectData

Type aliases for backward compatibility with types.UploadObjectData Deprecated: Use storage.UploadObjectData directly.

type UploadObjectRequest

type UploadObjectRequest struct {
	Path          string              `form:"path"`
	ContentType   string              `form:"contentType"`
	Content       string              `form:"content"`
	StorageClass  string              `form:"storageClass"`
	PreassignedID string              `form:"preassignedId"`
	File          objstore.ReadSeeker `form:"-" json:"-"`
	Size          int64               `form:"-" json:"-"`
	OriginalName  string              `form:"-" json:"-"`
}

UploadObjectRequest represents a request to upload an object

type UploadObjectRequestAlias

type UploadObjectRequestAlias = UploadObjectRequest

Type aliases for backward compatibility with types.UploadObjectRequest Deprecated: Use storage.UploadObjectRequest directly.

type UploadObjectResponse

type UploadObjectResponse struct {
	Path string `json:"path"`
}

UploadObjectResponse represents the response for uploading an object

type UploadObjectResponseAlias

type UploadObjectResponseAlias = UploadObjectResponse

Type aliases for backward compatibility with types.UploadObjectResponse Deprecated: Use storage.UploadObjectResponse directly.

Jump to

Keyboard shortcuts

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