Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func NewRememberToken ¶ added in v1.1.0
Types ¶
type File ¶
type File struct { ID string `json:"id,omitempty"` FolderID string `json:"folder_id,omitempty"` MD5 string `json:"md5,omitempty"` Name string `json:"name,omitempty"` Size int64 `json:"size,omitempty"` ContentType string `json:"content_type,omitempty"` Downloads int64 `json:"downloads,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` // relations (can be empty) Folder *Folder `json:"folder,omitempty"` }
type Folder ¶
type Folder struct { ID string `json:"id,omitempty"` SpaceID string `json:"space_id,omitempty"` Name string `json:"name,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` ExpiresAt time.Time `json:"expires_at,omitempty"` // relations (can be empty) Space *Space `json:"space,omitempty"` Files []*File `json:"files,omitempty"` }
func (*Folder) TotalDownloads ¶ added in v1.1.0
type Permissions ¶
type Permissions struct {
Admins []string
}
func (*Permissions) IsAdmin ¶
func (p *Permissions) IsAdmin(user *User) bool
func (*Permissions) IsSpaceAdmin ¶
func (p *Permissions) IsSpaceAdmin(user *User, space *Space) bool
type Space ¶
type Space struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Admins []string `json:"admins,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` // relations (can be empty) Folders []*Folder `json:"folders,omitempty"` }
type User ¶
type User struct { ID string `json:"id,omitempty"` Username string `json:"username,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` RememberToken string `json:"remember_token,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
Click to show internal directories.
Click to hide internal directories.