Documentation ¶
Index ¶
- Constants
- func AddRoutes(r *gin.Engine)
- func Close()
- func GetImageRelativeFolder(image *models.Image) string
- func InitServer()
- func InternalEngine() *gin.Engine
- func MaxSizeLimitationMiddleware() gin.HandlerFunc
- func PublicEngine() *gin.Engine
- func Run(config config.ServerConfig)
- type PackageType
- type RepositoryManager
- func (r *RepositoryManager) Close()
- func (r *RepositoryManager) Delete(c *gin.Context)
- func (r *RepositoryManager) Initialize() error
- func (r *RepositoryManager) Load(c *gin.Context)
- func (r *RepositoryManager) Query(c *gin.Context)
- func (r *RepositoryManager) StartLoop()
- func (r *RepositoryManager) Upload(c *gin.Context)
- type UploadFilePath
- type WorkManager
- func (w *WorkManager) Close()
- func (w *WorkManager) GetImageWorker(work workers.ImageWork) (workers.Worker, error)
- func (w *WorkManager) GetPullingImageWorker(image *models.Image, localFolder string, worker int) (*workers.ImagePuller, error)
- func (w *WorkManager) GetPushImageWorker(image *models.Image, localFolder string, worker int) (*workers.ImagePusher, error)
- func (w *WorkManager) GetVerifyingImageWorker(image *models.Image, localFolder string, worker int) (*workers.ImageVerifier, error)
- func (w *WorkManager) PerformImageWorks()
- func (w *WorkManager) StartLoop()
Constants ¶
const BROWSE_PREFIX = "/browse"
const MaxBodySize = 1024 * 1024 * 1024 * 20 //20GB
Variables ¶
This section is empty.
Functions ¶
func GetImageRelativeFolder ¶
func InitServer ¶
func InitServer()
func InternalEngine ¶
func MaxSizeLimitationMiddleware ¶
func MaxSizeLimitationMiddleware() gin.HandlerFunc
func PublicEngine ¶
func Run ¶
func Run(config config.ServerConfig)
Types ¶
type PackageType ¶
type PackageType string
type RepositoryManager ¶
type RepositoryManager struct { Context context.Context Logger *zap.Logger // contains filtered or unexported fields }
func NewRepositoryManager ¶
func NewRepositoryManager(ctx context.Context, config config.RepoManager, publicRouterGroup *gin.RouterGroup, internalRouterGroup *gin.RouterGroup, imageStore *storage.ImageStorage, baseFolder string, logger *zap.Logger) (*RepositoryManager, error)
func (*RepositoryManager) Close ¶
func (r *RepositoryManager) Close()
func (*RepositoryManager) Delete ¶
func (r *RepositoryManager) Delete(c *gin.Context)
Delete godoc @Summary delete an image by user ID and checksum @Param userID query string true "userID" @Param checksum query string true "checksum" @Description deletes an image by user ID and checksum @Tags Image @Accept json @Produce json @Success 200 object models.Image @Router / [delete]
func (*RepositoryManager) Initialize ¶
func (r *RepositoryManager) Initialize() error
func (*RepositoryManager) Load ¶
func (r *RepositoryManager) Load(c *gin.Context)
Load godoc @Summary create a image from external system @Param body body dtos.ImageRequest true "body for upload a image" @Description create a image with specified parameter, image will be downloaded via source url @Tags Image @Accept json @Produce json @Success 201 object models.Image @Router /load [post]
func (*RepositoryManager) Query ¶
func (r *RepositoryManager) Query(c *gin.Context)
Query godoc @Summary query image by external ID @Param externalID query string true "externalID" @Description Upload a image with specified parameter @Tags Image @Accept json @Produce json @Success 200 object models.Image @Router /query [get]
func (*RepositoryManager) StartLoop ¶
func (r *RepositoryManager) StartLoop()
func (*RepositoryManager) Upload ¶
func (r *RepositoryManager) Upload(c *gin.Context)
Upload godoc @Summary upload a image @Param body body dtos.ImageRequestWithinFile true "body for upload a image" @Description Upload a image with specified parameter @Tags Image @Accept json @Produce json @Success 201 object models.Image @Router /upload [post]
type UploadFilePath ¶
type UploadFilePath struct {
Path string
}
type WorkManager ¶
type WorkManager struct { Config config.WorkManager Logger *zap.Logger ImageStore *storage.ImageStorage WorkerChannel chan workers.ImageWork Context context.Context Notifier messages.Notifier // contains filtered or unexported fields }
func NewWorkManager ¶
func NewWorkManager(ctx context.Context, config config.WorkManager, logger *zap.Logger, imageStore *storage.ImageStorage, baseFolder string, notifier messages.Notifier) (*WorkManager, error)
func (*WorkManager) Close ¶
func (w *WorkManager) Close()
func (*WorkManager) GetImageWorker ¶
func (*WorkManager) GetPullingImageWorker ¶
func (w *WorkManager) GetPullingImageWorker(image *models.Image, localFolder string, worker int) (*workers.ImagePuller, error)
func (*WorkManager) GetPushImageWorker ¶
func (w *WorkManager) GetPushImageWorker(image *models.Image, localFolder string, worker int) (*workers.ImagePusher, error)
func (*WorkManager) GetVerifyingImageWorker ¶
func (w *WorkManager) GetVerifyingImageWorker(image *models.Image, localFolder string, worker int) (*workers.ImageVerifier, error)
func (*WorkManager) PerformImageWorks ¶
func (w *WorkManager) PerformImageWorks()
func (*WorkManager) StartLoop ¶
func (w *WorkManager) StartLoop()