impl

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package impl providers the main implementation of sync server APIs.

Index

Constants

This section is empty.

Variables

View Source
var FileSizeExceeded = errors.Errorf("Maximum file size for uploaded files exceeded.")

An error for empty storage path.

Functions

func InvalidFileTypeUploaded

func InvalidFileTypeUploaded(fileType string) *errors.Error

An error for invalid file type, which is not allowed to be uploaded.

func UploadHandler

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

Upload file handler for uploading large streamed files. A new file is saved under a directory named like the client device. An error will be rendered in the response if: - the file already exists; - the maximum allowed size is exceeded; - the file format is not allowed;

Types

type RequestError

type RequestError struct {
	StatusCode int

	Err error
}

func (*RequestError) BadRequest

func (r *RequestError) BadRequest() bool

func (*RequestError) Error

func (r *RequestError) Error() string

func (*RequestError) InternalServerError

func (r *RequestError) InternalServerError() bool

func (*RequestError) ServiceUnavailable

func (r *RequestError) ServiceUnavailable() bool

Jump to

Keyboard shortcuts

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