fileservice

package module
v0.0.0-...-56320f6 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoNothing

func DoNothing(w http.ResponseWriter, r *http.Request)

Types

type ApiServer

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

func CreateAPIServer

func CreateAPIServer(svc FileService) *ApiServer

func (*ApiServer) Delete

func (s *ApiServer) Delete(w http.ResponseWriter, r *http.Request)

func (*ApiServer) Get

func (s *ApiServer) Get(w http.ResponseWriter, r *http.Request)

func (*ApiServer) Set

func (s *ApiServer) Set(w http.ResponseWriter, r *http.Request)

func (*ApiServer) Start

func (s *ApiServer) Start(listenAddr string) error

type FileService

type FileService interface {
	Get(id int) (string, error)
	Set(path string) (int, error)
	Delete(id int) error
}

func CreateDefaultFileService

func CreateDefaultFileService() FileService

func CreateFileService

func CreateFileService(path string) FileService

func CreateFileServiceLogger

func CreateFileServiceLogger(svc FileService) FileService

type FileServiceController

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

func CreateController

func CreateController(ip, port string) FileServiceController

func CreateControllerByUrl

func CreateControllerByUrl(url string) FileServiceController

func (*FileServiceController) Delete

func (c *FileServiceController) Delete(id int) error

func (*FileServiceController) Get

func (c *FileServiceController) Get(id int) (string, error)

func (*FileServiceController) Set

func (c *FileServiceController) Set(path string) (int, error)

type FileServiceLogger

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

func (*FileServiceLogger) Delete

func (svc *FileServiceLogger) Delete(id int) (err error)

func (*FileServiceLogger) Get

func (svc *FileServiceLogger) Get(id int) (path string, err error)

func (*FileServiceLogger) Set

func (svc *FileServiceLogger) Set(path string) (id int, err error)

type LocalFileService

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

func (*LocalFileService) Delete

func (svc *LocalFileService) Delete(id int) error

func (*LocalFileService) Get

func (svc *LocalFileService) Get(id int) (string, error)

func (*LocalFileService) Set

func (svc *LocalFileService) Set(path string) (int, error)

Jump to

Keyboard shortcuts

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