package
5.0.2+incompatible
Repository: https://github.com/meateam/api-gateway.git
Documentation: pkg.go.dev
# Functions
AddPermissionsOnError add the deleted permissions when the file is failed to delete.
CheckUserFilePermission checks if userID is permitted to fileID with the wanted role.
CheckUserFileTransfer checks if userID is has a transfer to fileID.
CreateGetFileResponse Creates a file grpc response to http response struct.
CreatePermission creates permission in permission service only if userID has ppb.Role_WRITE permission to permission.FileID.
DeleteFile deletes fileID from file service and upload service, returns a slice of IDs of the files that were deleted if there were any files that are descendants of fileID and any error if occurred.
HandleStream streams the file bytes from stream to c.
HandleUpdate updates many files with the same value.
IsFileConvertableToPdf returns true if contentType can be converted to a PDF file, false otherwise.
NewRouter creates a new Router, and initializes clients of File Service and Download Service with the given connections.
# Constants
DeleteFileByIDRole is the role that is required of the authenticated requester to have to be permitted to make the DeleteFileByID action.
DocMimeType is the mime type of a .doc file.
DocxMimeType is the mime type of a .docx file.
DownloadRole is the role that is required of the authenticated requester to have to be permitted to make the Download action.
GetFileByIDRole is the role that is required of the authenticated requester to have to be permitted to make the GetFileByID action.
GetFilesByFolderRole is the role that is required of the authenticated requester to have to be permitted to make the GetFilesByFolder action.
OdpMimeType is the mime type of a .odp file.
OdtMimeType is the mime type of a .odt file.
OwnerRole is the owner role name when referred to as a permission.
ParamFileCreatedAt is a constant for file created at parameter in a request.
ParamFileDescription is a constant for file description parameter in a request.
ParamFileID is the name of the file id param in URL.
ParamFileName is a constant for file name parameter in a request.
ParamFileParent is a constant for file parent parameter in a request.
ParamFileSize is a constant for file size parameter in a request.
ParamFileType is a constant for file type parameter in a request.
ParamFileUpdatedAt is a constant for file updated at parameter in a request.
ParamPageNum is a constant for the requested page num in the pagination.
ParamPageSize is a constant for the requested page size in the pagination.
PdfMimeType is the mime type of a .pdf file.
PptMimeType is the mime type of a .ppt file.
PptxMimeType is the mime type of a .pptx file.
QueryAppID is a constant for queryAppId parameter in a request.
QueryFileDownloadPreview is the querystring key for removing the content-disposition header from a file download.
QueryShareFiles is the querystring key for retrieving the files that were shared with the user.
RtfMimeType is the mime type of a .rtf file.
TextMimeType is the start of any file with a text mime type.
UpdateFileRole is the role that is required of the authenticated requester to have to be permitted to make the UpdateFile action.
UpdateFilesRole is the role that is required of the authenticated requester to have to be permitted to make the UpdateFiles action.
XlsMimeType is the mime type of a .xls file.
XlsxMimeType is the mime type of a .xlsx file.
# Variables
AllowedAllOperationsApps are the applications which are allowed to do any operation open to external apps on files which are not theirs.
AllowedDownloadApps are the applications which are only allowed to download files which are not theirs.
TypesConvertableToPdf is a slice of the names of the mime types that can be converted to PDF and previewed.
# Structs
GetFileByIDResponse is a structure used for parsing fpb.File to a json file metadata response.
Permission is a struct that describes a user's permission to a file.
Router is a structure that handles upload requests.