service

package
v0.0.0-...-e8fae58 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package service is an abstraction layer for accessing external services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileDownloder

type FileDownloder interface {
	// DownloadFile downloads a file from external storage.
	DownloadFile(context.Context, *FileDownloderInput) (*FileDownloderOutput, error)
}

FileDownloder is an interface for download file to external storage.

type FileDownloderInput

type FileDownloderInput struct {
	// Config is S3 Config.
	Config config.S3
	// Key is the S3 key
	Key string
}

FileDownloderInput is an input struct for FileDownloader.

type FileDownloderOutput

type FileDownloderOutput struct {
	// Buffer is the downloaded data.
	*bytes.Buffer
}

FileDownloderOutput is an output struct for FileDownloader.

type FileUploader

type FileUploader interface {
	// UploadFile uploads a file from external storage.
	UploadFile(context.Context, *FileUploaderInput) (*FileUploaderOutput, error)
}

FileUploader is an interface for uploading files to external storage.

type FileUploaderInput

type FileUploaderInput struct {
	// Config is S3 Config.
	Config config.S3
	// Key is the S3 key
	Key string
	// Data is the data to upload.
	Data io.Reader
}

FileUploaderInput is an input struct for FileUploader.

type FileUploaderOutput

type FileUploaderOutput struct {
}

FileUploaderOutput is an output struct for FileUploader.

Jump to

Keyboard shortcuts

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