Versions in this module Expand all Collapse all v1 v1.1.0 Apr 20, 2020 Changes in this version + const HeaderChecksum + const HeaderFileID + func IsVideoPreview(pt PreviewType) bool type File + Checksum string + func (file *File) GetPublicNameWithExtension() string type FileResponseItem + Checksum string + type IDsResponse struct + IDs []uint type Namespace + func (namespace *Namespace) Create(db *gorm.DB) error + type Namespaceinfo struct + Groups []string + Name string type PreviewTemplate + MimeType string type PreviewType + const VideoPreviewType type Role + CreateNamespaces bool type UploadResponse + Checksum string + FileSize int64 + Namespace string type User + func (user *User) GetAllGroups(db *gorm.DB) ([]Group, error) + func (user *User) GetNamespaceName(namespace string) string + func (user *User) GetUsername() string + func (user User) CanCreateNamespaces() bool + type UserAttributeDataResponse struct + Namespace []Namespaceinfo + type UserAttributesRequest struct + Mode uint v1.0.0 Apr 5, 2020 Changes in this version + const ActionNotAllowed + const BatchSizeTooLarge + const HeaderContentLength + const HeaderContentType + const HeaderEncryption + const HeaderFileName + const HeaderRequest + const HeaderStatus + const HeaderStatusMessage + const InvalidCallbackURL + const InvalidTokenError + const MultipleSourceNameErr + const NotFoundError + const ServerError + const SessionTokenLength + const UserIsInvalidErr + const WrongInputFormatError + const WrongIntegerFormat + const WrongLength + var ErrorUserAlreadyExists = errors.New("user already exists") + var PreviewMimes map[PreviewType][]string = map[PreviewType][]string + func DirExists(path string) bool + func GetDefaultConfig() string + func GroupArrToStringArr(groups []Group) []string + func IsDefaultPreview(pt PreviewType) bool + func IsImagePreview(pt PreviewType) bool + func IsTextPreview(pt PreviewType) bool + func ShredderFile(localFile string, size int64) + func TagArrToStringArr(tags []Tag) []string + func UserNamespaceName(namespaceName string, user *User) string + type BulkPublishResponse struct + Files []UploadResponse + type Config struct + Server configServer + Webserver webserverConf + func InitConfig(confFile string, createMode bool) (*Config, bool) + func (config *Config) Check() bool + func (config Config) GetDefaultRole() *Role + func (config Config) GetHTMLFile(fileName string) string + func (config Config) GetStaticFile(fileName string) string + func (config Config) GetStorageFile(fileName string) string + func (config Config) GetTemplateFile(fileName string) string + func (config Config) IsRawUseragent(agent string) bool + type CountResponse struct + Count uint32 + type CredentialsRequest struct + MachineID string + Password string + Username string + type File struct + Encryption sql.NullInt32 + FileSize int64 + FileType string + Groups []Group + IsPublic bool + LocalName string + Name string + Namespace *Namespace + NamespaceID uint + PublicFilename sql.NullString + Tags []Tag + User *User + UserID uint + func FindFile(db *gorm.DB, fileID, userID uint) (*File, error) + func FindFiles(db *gorm.DB, file File) ([]File, error) + func GetPublicFile(db *gorm.DB, publicFilename string) (*File, bool, error) + func (file *File) AddGroups(db *gorm.DB, groupsToAdd []string, user *User) error + func (file *File) AddTags(db *gorm.DB, tagsToAdd []string, user *User) error + func (file *File) Delete(db *gorm.DB, config *Config) error + func (file *File) Insert(db *gorm.DB, user *User) error + func (file *File) Publish(db *gorm.DB, publicName string) (bool, error) + func (file *File) RemoveGroups(db *gorm.DB, groupsToRemove []string) error + func (file *File) RemoveTags(db *gorm.DB, tagsToRemove []string) error + func (file *File) Rename(db *gorm.DB, newName string) error + func (file *File) Save(db *gorm.DB) error + func (file *File) SetEncryption(encription string) *File + func (file *File) SetUniqueFilename(db *gorm.DB) bool + func (file *File) SetVilibility(db *gorm.DB, newVisibility bool) error + func (file *File) UpdateNamespace(db *gorm.DB, newNamespace *Namespace, user *User) error + func (file File) GetAttributes() FileAttributes + func (file File) GetCount(db *gorm.DB, fileID uint) (uint, error) + func (file File) GetNamespace() *Namespace + func (file File) HasGroup(sGroup string) bool + func (file File) HasTag(sTag string) bool + func (file File) IsInGroupList(groups []string) bool + func (file File) IsInTagList(tags []string) bool + type FileAttributes struct + Groups []string + Namespace string + Tags []string + type FileListRequest struct + AllNamespaces bool + Attributes FileAttributes + FileID uint + Name string + OptionalParams OptionalRequetsParameter + type FileRequest struct + All bool + Attributes FileAttributes + FileID uint + Name string + PublicName string + Updates FileUpdateItem + type FileResponseItem struct + Attributes FileAttributes + CreationDate time.Time + Encryption string + ID uint + IsPublic bool + Name string + PublicName string + Size int64 + type FileUpdateItem struct + AddGroups []string + AddTags []string + IsPublic string + NewName string + NewNamespace string + RemoveGroups []string + RemoveTags []string + type Group struct + Name string + Namespace *Namespace + NamespaceID uint + User *User + UserID uint + func FindGroup(db *gorm.DB, name string, namespace *Namespace, user *User) (*Group, error) + func FindGroups(db *gorm.DB, sGroups []string, namespace *Namespace) []Group + func GetGroup(db *gorm.DB, name string, namespace *Namespace, user *User) *Group + func GroupsFromStringArr(arr []string, namespace Namespace, user *User) []Group + func (group *Group) Insert(db *gorm.DB, user *User) error + func (group Group) GetNamespace() *Namespace + type ListFileResponse struct + Files []FileResponseItem + type LoginResponse struct + Namespace string + Token string + type LoginSession struct + MachineID string + Requests int64 + Token string + User *User + UserID uint + func NewSession(user *User, machineID string) *LoginSession + type Namespace struct + Name string + User *User + UserID uint + var DefaultNamespace Namespace + func FindNamespace(db *gorm.DB, ns string, user *User) *Namespace + func FindUserNamespaces(db *gorm.DB, user *User) ([]Namespace, error) + func GetNamespaceFromString(ns string) *Namespace + func (namespace *Namespace) IsOwnedBy(user *User) bool + func (namespace *Namespace) IsValid() bool + type NamespaceRequest struct + Namespace string + NewName string + Type NamespaceType + type NamespaceType uint8 + const CustomNamespaceType + const UserNamespaceType + type OptionalRequetsParameter struct + Verbose uint8 + type Permission uint8 + const NoPermission + const ReadPermission + const Writepermission + type PingRequest struct + Payload string + type PreviewTemplate struct + Encrypted bool + FileSizeStr string + Filename string + Host string + PreviewType PreviewType + PublicFilename string + type PreviewType uint8 + const DefaultPreviewType + const ImagePreviewType + const TextPreviewType + func PreviewTypeFromMime(sMime string) PreviewType + type PublishResponse struct + PublicFilename string + type ResponseStatus uint8 + const ResponseError + const ResponseSuccess + type Role struct + AccesForeignNamespaces Permission + CreateCustomNamespaces bool + CreateUserNamespaces bool + ID uint + IsAdmin bool + MaxURLcontentSize int64 + MaxUploadFileSize int64 + RoleName string + type StringResponse struct + String string + type StringSliceResponse struct + Slice []string + type Tag struct + Name string + Namespace *Namespace + NamespaceID uint + User *User + UserID uint + func FindTag(db *gorm.DB, name string, namespace *Namespace, user *User) (*Tag, error) + func FindTags(db *gorm.DB, sTags []string, namespace *Namespace) []Tag + func GetTag(db *gorm.DB, name string, namespace *Namespace, user *User) *Tag + func TagsFromStringArr(arr []string, namespace Namespace, user *User) []Tag + func (tag *Tag) Insert(db *gorm.DB, user *User) error + func (tag Tag) GetNamespace() *Namespace + type UpdateAttributeRequest struct + Name string + Namespace string + NewName string + type UploadRequest struct + Attributes FileAttributes + Encryption string + Name string + Public bool + PublicName string + ReplaceFile uint + Size int64 + URL string + UploadType UploadType + type UploadResponse struct + FileID uint + Filename string + PublicFilename string + type UploadType uint8 + const FileUploadType + const URLUploadType + type User struct + Password string + Role *Role + RoleID uint + Username string + func GetUserFromSession(db *gorm.DB, token string) (*User, error) + func (user *User) CreateDefaultNamespace(db *gorm.DB) (*Namespace, error) + func (user *User) GetDefaultNamespaceName() string + func (user *User) Has(db *gorm.DB, checkPass bool) (bool, error) + func (user *User) HasAccess(namespace *Namespace) bool + func (user *User) Login(db *gorm.DB, machineID string) (*LoginSession, error) + func (user User) AllowedToUploadURLs() bool + func (user User) CanCreateCustomNamespaces() bool + func (user User) CanCreateUserNamespaces() bool + func (user User) CanReadForeignNamespace() bool + func (user User) CanUploadFiles() bool + func (user User) CanWriteForeignNamespace() bool + func (user User) HasUploadLimit() bool + func (user User) Register(db *gorm.DB, config *Config) error