imagesservice

package
v0.0.0-...-d9bd7fb Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImagesService

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

func NewImagesService

func NewImagesService(cfg *ImagesServiceConfig,
	logger *logrus.Logger,
	imagesStorageAddr string,
	imageStorageSecureConfig config.ConnectionSecureConfig,
	imageProcessingAddr string,
	imageProcessingSecureConfig config.ConnectionSecureConfig) (*ImagesService, error)

func (*ImagesService) DeleteImage

func (s *ImagesService) DeleteImage(ctx context.Context, imageID string) (err error)

func (*ImagesService) GetProfilePictureURL

func (s *ImagesService) GetProfilePictureURL(ctx context.Context, pictureID string) string

Returns profile picture url for GET request, or returns empty string if there are error or picture unreachable

func (*ImagesService) ReplaceImage

func (s *ImagesService) ReplaceImage(ctx context.Context, image []byte,
	imageID string, createIfNotExist bool) (newPictureID string, err error)

func (*ImagesService) ResizeImage

func (s *ImagesService) ResizeImage(ctx context.Context, image []byte) (resizedImage []byte, err error)

func (*ImagesService) Shutdown

func (s *ImagesService) Shutdown()

func (*ImagesService) UploadImage

func (s *ImagesService) UploadImage(ctx context.Context, image []byte) (imageID string, err error)

type ImagesServiceConfig

type ImagesServiceConfig struct {
	ImageWidth        int32
	ImageHeight       int32
	ImageResizeMethod string

	BaseProfilePictureURL  string
	ProfilePictureCategory string

	AllowedTypes   []string
	MaxImageWidth  int32
	MaxImageHeight int32
	MinImageWidth  int32
	MinImageHeight int32

	CheckProfilePictureExistance bool
}

Jump to

Keyboard shortcuts

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