file

package
v0.0.0-...-713cdd6 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	SaveFile(path string, file *multipart.FileHeader) (string, error)
	CreateDirectory(dirName string) bool
	ExtWhitelist(path string) (string, error)
}

DataSource is the interface

func NewDataSource

func NewDataSource() DataSource

NewDataSource is new instance

func ProvideFileDataSource

func ProvideFileDataSource() DataSource

type Handler

type Handler interface {
	Upload(c echo.Context) error
}

Handler is the interface

func NewHandler

func NewHandler(uc UseCase) Handler

NewHandler is new instance

func ProvideHandler

func ProvideHandler() Handler

type Repository

type Repository interface {
	SaveFile(m *multipart.FileHeader) (string, error)
}

Repository is the interface

func NewRepository

func NewRepository(datasource DataSource) Repository

NewRepository is the create repository

func ProvideRepository

func ProvideRepository() Repository

type Route

type Route interface {
	Initial(e *echo.Echo)
}

Route is the interface

func NewRoute

func NewRoute(handle Handler) Route

NewRoute is new instance

func ProvideRoute

func ProvideRoute() Route

type UseCase

type UseCase interface {
	Upload(m *multipart.FileHeader) (string, error)
}

UseCase is the interface

func NewUseCase

func NewUseCase(repo Repository) UseCase

NewUseCase is the create usecase

func ProvideUseCase

func ProvideUseCase() UseCase

Jump to

Keyboard shortcuts

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