application

package
v0.0.0-...-6ed6c48 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const BROWSE_PREFIX = "/browse"
View Source
const MaxBodySize = 1024 * 1024 * 1024 * 20 //20GB

Variables

This section is empty.

Functions

func AddRoutes

func AddRoutes(r *gin.Engine)

func Close

func Close()

func GetImageRelativeFolder

func GetImageRelativeFolder(image *models.Image) string

func InitServer

func InitServer()

func InternalEngine

func InternalEngine() *gin.Engine

func MaxSizeLimitationMiddleware

func MaxSizeLimitationMiddleware() gin.HandlerFunc

func PublicEngine

func PublicEngine() *gin.Engine

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 (w *WorkManager) GetImageWorker(work workers.ImageWork) (workers.Worker, error)

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()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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