registry

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionUpload               = "upload"
	ActionDownload             = "download"
	ActionList                 = "list"
	ActionRemove               = "remove"
	ActionCreateDirectory      = "createDirectory"
	ActionGeneratePresignedURL = "generatePresignedURL"
	ActionSyncFiles            = "syncFiles"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHandler

type BaseHandler struct {
	Ctx                    context.Context
	RegistryManager        *registry.Manager
	GetRegistryAndRootPath func(namespace, name string) (string, string, error)

	PostHooks map[string]PostHook
}

func (BaseHandler) ServeHTTP

func (h BaseHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type CreateDirectoryInput

type CreateDirectoryInput struct {
	TargetDirectory string `json:"targetDirectory"`
}

type DownloadInput

type DownloadInput struct {
	TargetFilePath string `json:"targetFilePath"`
}

type GeneratePresignedURLInput

type GeneratePresignedURLInput struct {
	ObjectName  string `json:"objectName"`            // The object name/path in storage
	Operation   string `json:"operation"`             // "upload" or "download"
	ContentType string `json:"contentType,omitempty"` // Content type for upload (optional)
	ExpiryHours int    `json:"expiryHours,omitempty"` // Expiry time in hours (default: 1 hour)
}

type GeneratePresignedURLOutput

type GeneratePresignedURLOutput struct {
	PresignedURL string `json:"presignedURL"`
	ExpiresAt    string `json:"expiresAt"`
	Operation    string `json:"operation"`
}

type ListInput

type ListInput DownloadInput

type PostHook

type PostHook func(req *http.Request, b backend.Backend) error

type Progress

type Progress struct {
	DestPath  string `json:"destPath"`
	TotalSize int64  `json:"totalSize"`
	ReadSize  int64  `json:"readSize"`
}

type RemoveInput

type RemoveInput DownloadInput

type ResponseWriterSync

type ResponseWriterSync struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ResponseWriterSync wraps an http.ResponseWriter with a mutex for thread safety

func (*ResponseWriterSync) Flush

func (r *ResponseWriterSync) Flush()

Flush safely flushes the underlying ResponseWriter with mutex protection

func (*ResponseWriterSync) Write

func (r *ResponseWriterSync) Write(p []byte) (n int, err error)

Write safely writes to the underlying ResponseWriter with mutex protection

type UploadInput

type UploadInput struct {
	// TargetDirectory is the directory path where the file will be stored
	// This is a required field for all uploads
	TargetDirectory string `json:"targetDirectory"`
	// RelativePaths is now a slice of strings, corresponding to the order of files
	RelativePaths []string `json:"relativePaths"`
}

Jump to

Keyboard shortcuts

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