Documentation ¶
Index ¶
- Variables
- type AuthPayload
- type File
- type FileCollaborator
- type FileCollaboratorConnection
- type FileCollaboratorEdge
- type FileCollaboratorInput
- type FileConnection
- type FileEdge
- type FileInput
- type FilePermission
- type FileTag
- type FileTagConnection
- type FileTagEdge
- type FileTagsInput
- type FileUpdateInput
- type PageInfo
- type Tag
- type TagConnection
- type TagEdge
- type User
- type UserConnection
- type UserEdge
- type UserInput
- type UserKind
- type UserUpdateInput
Constants ¶
This section is empty.
Variables ¶
View Source
var AllFilePermission = []FilePermission{ FilePermissionAdmin, FilePermissionMaintain, FilePermissionWrite, FilePermissionRead, }
View Source
var AllUserKind = []UserKind{ UserKindAdmin, UserKindUser, UserKindBanned, }
Functions ¶
This section is empty.
Types ¶
type AuthPayload ¶
type File ¶
type File struct { ID string `json:"id" gorm:"type:varchar(20);primaryKey;not null"` Name string `json:"name" gorm:"type:varchar(255);not null"` MimeType string `json:"mimeType" gorm:"type:varchar(127);not null"` Extension string `json:"extension" gorm:"type:varchar(10);not null"` Size int64 `json:"size" gorm:"type:bigint; not null"` FileTags []FileTag Collaborators []FileCollaborator CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt"` }
type FileCollaborator ¶
type FileCollaborator struct { FileID string `json:"fileId" gorm:"foreignKey;uniqueIndex:file_collaborator;not null"` CollaboratorID string `json:"collaboratorId" gorm:"foreignKey;uniqueIndex:file_collaborator;not null"` Permission int8 `json:"permission" gorm:"type:tinyint;not null"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt"` }
type FileCollaboratorConnection ¶
type FileCollaboratorConnection struct { Edges []*FileCollaboratorEdge `json:"edges"` Nodes []*User `json:"nodes"` PageInfo *PageInfo `json:"pageInfo"` }
type FileCollaboratorEdge ¶
type FileCollaboratorEdge struct { Cursor string `json:"cursor"` Node *User `json:"node"` Permission FilePermission `json:"permission"` }
type FileCollaboratorInput ¶
type FileCollaboratorInput struct { FileID string `json:"fileId" validate:"required,alphanum,len=20"` CollaboratorID string `json:"collaboratorId" validate:"required,alphanum,len=20"` Permission FilePermission `json:"permission"` }
type FileConnection ¶
type FilePermission ¶
type FilePermission string
const ( FilePermissionAdmin FilePermission = "ADMIN" FilePermissionMaintain FilePermission = "MAINTAIN" FilePermissionWrite FilePermission = "WRITE" FilePermissionRead FilePermission = "READ" )
func (FilePermission) IsValid ¶
func (e FilePermission) IsValid() bool
func (FilePermission) MarshalGQL ¶
func (e FilePermission) MarshalGQL(w io.Writer)
func (FilePermission) String ¶
func (e FilePermission) String() string
func (*FilePermission) UnmarshalGQL ¶
func (e *FilePermission) UnmarshalGQL(v interface{}) error
type FileTagConnection ¶
type FileTagConnection struct { Edges []*FileTagEdge `json:"edges"` Nodes []*Tag `json:"nodes"` PageInfo *PageInfo `json:"pageInfo"` }
type FileTagEdge ¶
type FileTagsInput ¶
type FileUpdateInput ¶
type Tag ¶
type Tag struct { ID string `json:"id" gorm:"type:varchar(20);primaryKey;not null"` Name string `json:"name" gorm:"type:varchar(32);unique;not null"` FileTags []FileTag `gorm:"foreignKey:TagName;references:Name"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt"` }
type TagConnection ¶
type User ¶
type User struct { ID string `json:"id" gorm:"type:varchar(20);primaryKey;not null"` Username string `json:"username" gorm:"type:varchar(64);unique;not null"` Password string `gorm:"type:varchar(128);not null"` Kind UserKind `json:"kind" gorm:"type:varchar(8);not null"` Collaborators []FileCollaborator `gorm:"foreignKey:CollaboratorID"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt"` }
type UserConnection ¶
type UserUpdateInput ¶
Click to show internal directories.
Click to hide internal directories.