Documentation ¶
Index ¶
- Variables
- func Decode(ctx *gin.Context, decoder Decoder) error
- type AddUserReq
- type AddVendorBackendReq
- type AdminRoomPasswordReq
- type AdminSettingsReq
- type AdminSettingsResp
- type AdminUserPasswordReq
- type AdminUsernameReq
- type ApiResp
- type CreateRoomReq
- type CurrentMovieResp
- type Decoder
- type EditMovieReq
- type FormatEmptyPasswordError
- type GetUserBindEmailStep1CaptchaResp
- type GetVendorBackendResp
- type IdCanEmptyReq
- type IdReq
- type IdsReq
- type Item
- type LoginRoomReq
- type LoginUserReq
- type MovieResp
- type OAuth2CallbackReq
- type OAuth2Req
- type Path
- type PushMovieReq
- type PushMoviesReq
- type RoomApproveMemberReq
- type RoomBanMemberReq
- type RoomIDReq
- type RoomListResp
- type RoomMeResp
- type RoomMembersResp
- type RoomSetAdminPermissionsReq
- type RoomSetAdminReq
- type RoomSetMemberPermissionsReq
- type RoomSetMemberReq
- type RoomUnbanMemberReq
- type SendTestEmailReq
- type SendUserRetrievePasswordEmailCaptchaReq
- type SendUserSignupEmailCaptchaReq
- type ServerIDReq
- type SetRoomPasswordReq
- type SetRoomSettingReq
- type SetUserPasswordReq
- type SetUsernameReq
- type SwapMovieReq
- type UserBindEmailReq
- type UserBindProviderResp
- type UserIDReq
- type UserInfoResp
- type UserRetrievePasswordEmailReq
- type UserSendBindEmailCaptchaReq
- type UserSignupEmailReq
- type VendorBackendEndpointsReq
- type VendorFSListResp
- type VendorMeResp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidOAuth2Code = errors.New("invalid oauth2 code") ErrInvalidOAuth2State = errors.New("invalid oauth2 state") )
View Source
var ( ErrUrlTooLong = errors.New("url too long") ErrEmptyName = errors.New("empty name") ErrTypeTooLong = errors.New("type too long") ErrId = errors.New("id must be greater than 0") ErrEmptyIds = errors.New("empty ids") )
View Source
var ( ErrEmptyRoomName = errors.New("empty room name") ErrRoomNameTooLong = errors.New("room name too long") ErrRoomNameHasInvalidChar = errors.New("room name has invalid char") ErrPasswordTooLong = errors.New("password too long") ErrPasswordHasInvalidChar = errors.New("password has invalid char") )
View Source
var ( ErrEmptyUserId = errors.New("empty user id") ErrEmptyUsername = errors.New("empty username") ErrUsernameTooLong = errors.New("username too long") ErrUsernameHasInvalidChar = errors.New("username has invalid char") )
View Source
var ( ErrEmailTooLong = errors.New("email is too long") ErrInvalidEmail = errors.New("invalid email") )
View Source
var (
ErrInvalidID = errors.New("invalid id")
)
Functions ¶
Types ¶
type AddUserReq ¶ added in v0.3.0
type AddUserReq struct { Username string `json:"username"` Password string `json:"password"` Role dbModel.Role `json:"role"` }
func (*AddUserReq) Validate ¶ added in v0.3.0
func (aur *AddUserReq) Validate() error
type AddVendorBackendReq ¶ added in v0.3.1
type AddVendorBackendReq model.VendorBackend
func (*AddVendorBackendReq) Decode ¶ added in v0.3.1
func (avbr *AddVendorBackendReq) Decode(ctx *gin.Context) error
func (*AddVendorBackendReq) Validate ¶ added in v0.3.1
func (avbr *AddVendorBackendReq) Validate() error
type AdminRoomPasswordReq ¶ added in v0.3.0
func (*AdminRoomPasswordReq) Decode ¶ added in v0.3.0
func (aur *AdminRoomPasswordReq) Decode(ctx *gin.Context) error
func (*AdminRoomPasswordReq) Validate ¶ added in v0.3.0
func (aur *AdminRoomPasswordReq) Validate() error
type AdminSettingsReq ¶ added in v0.3.0
func (*AdminSettingsReq) Decode ¶ added in v0.3.0
func (asr *AdminSettingsReq) Decode(ctx *gin.Context) error
func (*AdminSettingsReq) Validate ¶ added in v0.3.0
func (asr *AdminSettingsReq) Validate() error
type AdminSettingsResp ¶ added in v0.3.0
type AdminSettingsResp map[dbModel.SettingGroup]map[string]any
type AdminUserPasswordReq ¶ added in v0.3.0
func (*AdminUserPasswordReq) Decode ¶ added in v0.3.0
func (aur *AdminUserPasswordReq) Decode(ctx *gin.Context) error
func (*AdminUserPasswordReq) Validate ¶ added in v0.3.0
func (aur *AdminUserPasswordReq) Validate() error
type AdminUsernameReq ¶ added in v0.3.0
func (*AdminUsernameReq) Decode ¶ added in v0.3.0
func (aur *AdminUsernameReq) Decode(ctx *gin.Context) error
func (*AdminUsernameReq) Validate ¶ added in v0.3.0
func (aur *AdminUsernameReq) Validate() error
type ApiResp ¶
type ApiResp struct { Time int64 `json:"time"` Error string `json:"error,omitempty"` Data any `json:"data,omitempty"` }
func NewApiDataResp ¶
func NewApiErrorResp ¶
func NewApiErrorStringResp ¶
type CreateRoomReq ¶
type CreateRoomReq struct { RoomName string `json:"roomName"` Password string `json:"password"` Settings struct { Hidden bool `json:"hidden"` } `json:"settings"` }
func (*CreateRoomReq) Validate ¶
func (c *CreateRoomReq) Validate() error
type CurrentMovieResp ¶ added in v0.3.0
type EditMovieReq ¶
type EditMovieReq struct { IdReq PushMovieReq }
func (*EditMovieReq) Validate ¶
func (e *EditMovieReq) Validate() error
type FormatEmptyPasswordError ¶ added in v0.3.0
type FormatEmptyPasswordError string
func (FormatEmptyPasswordError) Error ¶ added in v0.3.0
func (f FormatEmptyPasswordError) Error() string
type GetUserBindEmailStep1CaptchaResp ¶ added in v0.4.5
type GetVendorBackendResp ¶ added in v0.3.1
type GetVendorBackendResp struct { Info *dbModel.VendorBackend `json:"info"` Status connectivity.State `json:"status"` }
type IdCanEmptyReq ¶ added in v0.3.0
type IdCanEmptyReq struct {
Id string `json:"id"`
}
func (*IdCanEmptyReq) Decode ¶ added in v0.3.0
func (i *IdCanEmptyReq) Decode(ctx *gin.Context) error
func (*IdCanEmptyReq) Validate ¶ added in v0.3.0
func (i *IdCanEmptyReq) Validate() error
type LoginRoomReq ¶
func (*LoginRoomReq) Validate ¶
func (l *LoginRoomReq) Validate() error
type LoginUserReq ¶ added in v0.3.0
func (*LoginUserReq) Validate ¶ added in v0.3.0
func (l *LoginUserReq) Validate() error
type OAuth2CallbackReq ¶ added in v0.3.0
func (*OAuth2CallbackReq) Decode ¶ added in v0.3.0
func (o *OAuth2CallbackReq) Decode(ctx *gin.Context) error
func (*OAuth2CallbackReq) Validate ¶ added in v0.3.0
func (o *OAuth2CallbackReq) Validate() error
type PushMovieReq ¶
func (*PushMovieReq) Validate ¶
func (p *PushMovieReq) Validate() error
type PushMoviesReq ¶ added in v0.3.0
type PushMoviesReq []*PushMovieReq
func (*PushMoviesReq) Decode ¶ added in v0.3.0
func (p *PushMoviesReq) Decode(ctx *gin.Context) error
func (*PushMoviesReq) Validate ¶ added in v0.3.0
func (p *PushMoviesReq) Validate() error
type RoomApproveMemberReq ¶ added in v0.5.0
type RoomApproveMemberReq = UserIDReq
type RoomBanMemberReq ¶ added in v0.5.0
type RoomBanMemberReq = UserIDReq
type RoomListResp ¶
type RoomListResp struct { RoomId string `json:"roomId"` RoomName string `json:"roomName"` PeopleNum int64 `json:"peopleNum"` NeedPassword bool `json:"needPassword"` CreatorID string `json:"creatorId"` Creator string `json:"creator"` CreatedAt int64 `json:"createdAt"` Status model.RoomStatus `json:"status"` }
type RoomMeResp ¶ added in v0.5.0
type RoomMeResp struct { UserID string `json:"userId"` RoomID string `json:"roomId"` JoinAt int64 `json:"joinAt"` Role dbModel.RoomMemberRole `json:"role"` Permissions dbModel.RoomMemberPermission `json:"permissions"` AdminPermissions dbModel.RoomAdminPermission `json:"adminPermissions"` }
type RoomMembersResp ¶ added in v0.5.0
type RoomMembersResp struct { UserID string `json:"userId"` Username string `json:"username"` JoinAt int64 `json:"joinAt"` OnlineCount int `json:"onlineCount"` Role dbModel.RoomMemberRole `json:"role"` Status dbModel.RoomMemberStatus `json:"status"` RoomID string `json:"roomId"` Permissions dbModel.RoomMemberPermission `json:"permissions"` AdminPermissions dbModel.RoomAdminPermission `json:"adminPermissions"` }
type RoomSetAdminPermissionsReq ¶ added in v0.5.0
type RoomSetAdminPermissionsReq struct { UserIDReq AdminPermissions dbModel.RoomAdminPermission `json:"adminPermissions"` }
type RoomSetAdminReq ¶ added in v0.5.0
type RoomSetAdminReq struct { UserIDReq AdminPermissions dbModel.RoomAdminPermission `json:"adminPermissions"` }
type RoomSetMemberPermissionsReq ¶ added in v0.5.0
type RoomSetMemberPermissionsReq struct { UserIDReq Permissions dbModel.RoomMemberPermission `json:"permissions"` }
type RoomSetMemberReq ¶ added in v0.5.0
type RoomSetMemberReq struct { UserIDReq Permissions dbModel.RoomMemberPermission `json:"permissions"` }
type RoomUnbanMemberReq ¶ added in v0.5.0
type RoomUnbanMemberReq = UserIDReq
type SendTestEmailReq ¶ added in v0.4.5
type SendTestEmailReq struct {
Email string `json:"email"`
}
func (*SendTestEmailReq) Decode ¶ added in v0.4.5
func (ster *SendTestEmailReq) Decode(ctx *gin.Context) error
func (*SendTestEmailReq) Validate ¶ added in v0.4.5
func (ster *SendTestEmailReq) Validate() error
type SendUserRetrievePasswordEmailCaptchaReq ¶ added in v0.4.5
type SendUserRetrievePasswordEmailCaptchaReq = UserSendBindEmailCaptchaReq
type SendUserSignupEmailCaptchaReq ¶ added in v0.4.5
type SendUserSignupEmailCaptchaReq = UserSendBindEmailCaptchaReq
type ServerIDReq ¶ added in v0.3.2
type ServerIDReq struct {
ServerID string `json:"serverId"`
}
func (*ServerIDReq) Validate ¶ added in v0.3.2
func (r *ServerIDReq) Validate() error
type SetRoomPasswordReq ¶
type SetRoomPasswordReq struct {
Password string `json:"password"`
}
func (*SetRoomPasswordReq) Validate ¶
func (s *SetRoomPasswordReq) Validate() error
type SetRoomSettingReq ¶ added in v0.3.0
func (*SetRoomSettingReq) Decode ¶ added in v0.3.0
func (s *SetRoomSettingReq) Decode(ctx *gin.Context) error
func (*SetRoomSettingReq) Validate ¶ added in v0.3.0
func (s *SetRoomSettingReq) Validate() error
type SetUserPasswordReq ¶
type SetUserPasswordReq struct {
Password string `json:"password"`
}
func (*SetUserPasswordReq) Validate ¶
func (s *SetUserPasswordReq) Validate() error
type SetUsernameReq ¶ added in v0.3.0
type SetUsernameReq struct {
Username string `json:"username"`
}
func (*SetUsernameReq) Decode ¶ added in v0.3.0
func (s *SetUsernameReq) Decode(ctx *gin.Context) error
func (*SetUsernameReq) Validate ¶ added in v0.3.0
func (s *SetUsernameReq) Validate() error
type SwapMovieReq ¶
func (*SwapMovieReq) Validate ¶
func (s *SwapMovieReq) Validate() error
type UserBindEmailReq ¶ added in v0.4.5
func (*UserBindEmailReq) Decode ¶ added in v0.4.5
func (u *UserBindEmailReq) Decode(ctx *gin.Context) error
func (*UserBindEmailReq) Validate ¶ added in v0.4.5
func (u *UserBindEmailReq) Validate() error
type UserBindProviderResp ¶ added in v0.3.0
type UserBindProviderResp map[provider.OAuth2Provider]struct { ProviderUserID string `json:"providerUserID"` CreatedAt int64 `json:"createdAt"` }
type UserInfoResp ¶ added in v0.3.0
type UserRetrievePasswordEmailReq ¶ added in v0.4.5
type UserRetrievePasswordEmailReq struct { Email string `json:"email"` Captcha string `json:"captcha"` Password string `json:"password"` }
func (*UserRetrievePasswordEmailReq) Decode ¶ added in v0.4.5
func (u *UserRetrievePasswordEmailReq) Decode(ctx *gin.Context) error
func (*UserRetrievePasswordEmailReq) Validate ¶ added in v0.4.5
func (u *UserRetrievePasswordEmailReq) Validate() error
type UserSendBindEmailCaptchaReq ¶ added in v0.4.5
type UserSendBindEmailCaptchaReq struct { Email string `json:"email"` CaptchaID string `json:"captchaID"` Answer string `json:"answer"` }
func (*UserSendBindEmailCaptchaReq) Decode ¶ added in v0.4.5
func (u *UserSendBindEmailCaptchaReq) Decode(ctx *gin.Context) error
func (*UserSendBindEmailCaptchaReq) Validate ¶ added in v0.4.5
func (u *UserSendBindEmailCaptchaReq) Validate() error
type UserSignupEmailReq ¶ added in v0.4.5
type UserSignupEmailReq struct { UserBindEmailReq Password string `json:"password"` }
func (*UserSignupEmailReq) Decode ¶ added in v0.4.5
func (u *UserSignupEmailReq) Decode(ctx *gin.Context) error
func (*UserSignupEmailReq) Validate ¶ added in v0.4.5
func (u *UserSignupEmailReq) Validate() error
type VendorBackendEndpointsReq ¶ added in v0.3.1
type VendorBackendEndpointsReq struct {
Endpoints []string `json:"endpoints"`
}
func (*VendorBackendEndpointsReq) Decode ¶ added in v0.3.1
func (dvbr *VendorBackendEndpointsReq) Decode(ctx *gin.Context) error
func (*VendorBackendEndpointsReq) Validate ¶ added in v0.3.1
func (dvbr *VendorBackendEndpointsReq) Validate() error
type VendorFSListResp ¶ added in v0.3.1
type VendorMeResp ¶ added in v0.3.1
Click to show internal directories.
Click to hide internal directories.