imagecompressor

package module
v0.0.0-...-51e4ec8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 4 Imported by: 0

README

imagecompressor

A Go library for image compression using a client interface. The library abstracts the underlying image compressor service and provides a simple way to upload and retrieve the compressed file.

Here are some clients we have for some Compressor Services:

Documentation

Overview

Package imagecompressor is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Upload uploads the image to the Image Compressor service given by object
	// and return the CompressedFile data structure.
	// NOTE:
	// filename could be optional depending on the image compressor service.
	// Currently only reSmush required filename when uploading to their service.
	Upload(ctx context.Context, file io.Reader, filename string) (*CompressedFile, error)
}

Client is an interface for Image Compressor service.

type CompressedFile

type CompressedFile struct {
	// URL is the public URL for the compressed file.
	URL string
}

CompressedFile is a data structure for compressed file in the image compression service.

type GoMockClient

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

GoMockClient is a mock of Client interface.

func NewGoMockClient

func NewGoMockClient(ctrl *gomock.Controller) *GoMockClient

NewGoMockClient creates a new mock instance.

func (*GoMockClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*GoMockClient) Upload

func (m *GoMockClient) Upload(ctx context.Context, file io.Reader, filename string) (*CompressedFile, error)

Upload mocks base method.

type GoMockClientMockRecorder

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

GoMockClientMockRecorder is the mock recorder for GoMockClient.

func (*GoMockClientMockRecorder) Upload

func (mr *GoMockClientMockRecorder) Upload(ctx, file, filename interface{}) *gomock.Call

Upload indicates an expected call of Upload.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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