cacherepositories

package
v0.0.0-...-7ec155d Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCachedImageNotFound      = errors.New("cached image not found")
	ErrCachedImageAlreadyExists = errors.New("cached image already exists")
)
View Source
var (
	ErrImageAlreadyExists = errors.New("image already exists")
	ErrImageNotFound      = errors.New("image not found")
)
View Source
var (
	ErrCommitHashNotAllowed  = errors.New("this commit hash is not allowed")
	ErrProjectNameNotAllowed = errors.New("this project name is not allowed")
	ErrProjectNotFound       = errors.New("project not found")
)

Functions

This section is empty.

Types

type CachedImageModel

type CachedImageModel struct {
	RawRequest       string `json:"rawRequest" bson:"rawRequest"`
	RequestSignature string `json:"requestSignature" bson:"requestSignature"`

	ProcessorType     string `json:"processorType" bson:"processorType"`
	ProcessorEndpoint string `json:"processorEndpoint" bson:"processorEndpoint"`

	MimeType         string              `json:"mimeType" bson:"mimeType"`
	ImageSize        int64               `json:"imageSize" bson:"imageSize"`
	SourceImageURL   string              `json:"sourceImageURL" bson:"sourceImageURL"`
	ProcessingParams map[string][]string `json:"processingParams" bson:"processingParams"`
}

type CachedImagesRepository

type CachedImagesRepository interface {
	CreateCachedImageInfo(ctx context.Context, info CachedImageModel) error
	DeleteCachedImageInfo(ctx context.Context, requestSignature, processorType string) error
	GetCachedImageInfo(ctx context.Context, requestSignature, processorType string) (CachedImageModel, error)
	GetCachedImageInfosOfSource(ctx context.Context, sourceImageURL string) ([]CachedImageModel, error)
}

type CachedImagesStorage

type CachedImagesStorage interface {
	Save(ctx context.Context, requestSignature, processorType, mimeType string, size int64, reader hub.DataStreamOutput) error
	Get(ctx context.Context, requestSignature, processorType string, writer hub.DataStreamInput) error
	Delete(ctx context.Context, requestSignature, processorType string) error
}

type InvalidationModel

type InvalidationModel struct {
	ProjectName string `json:"projectName" bson:"projectName"`
	CommitHash  string `json:"commitHash" bson:"commitHash"`

	InvalidationDate       time.Time          `json:"invalidationDate" bson:"invalidationDate"`
	RequestedInvalidations []string           `json:"requestedInvalidations" bson:"requestedInvalidations"`
	DoneInvalidations      []string           `json:"doneInvalidations" bson:"doneInvalidations"`
	InvalidatedImages      []CachedImageModel `json:"invalidatedImages" bson:"invalidatedImages"`
	InvalidationError      *string            `json:"invalidationError" bson:"invalidationError"`
}

type InvalidationsRepository

type InvalidationsRepository interface {
	CreateInvalidation(ctx context.Context, invalidation InvalidationModel) error
	GetLatestInvalidation(ctx context.Context, projectName string) (InvalidationModel, error)
}

Directories

Path Synopsis
Package mock_cacherepositories is a generated GoMock package.
Package mock_cacherepositories is a generated GoMock package.

Jump to

Keyboard shortcuts

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