Documentation
¶
Index ¶
- Variables
- func Decode(ctx *gin.Context, decoder Decoder) error
- type AdminSettingsReq
- type AdminSettingsResp
- type ApiResp
- type CreateRoomReq
- type CurrentMovieResp
- type Decoder
- type EditMovieReq
- type FormatEmptyPasswordError
- type IdCanEmptyReq
- type IdReq
- type IdsReq
- type LoginRoomReq
- type LoginUserReq
- type MoviesResp
- type OAuth2CallbackReq
- type PushMovieReq
- type PushMoviesReq
- type RoomIDReq
- type RoomListResp
- type RoomUsersResp
- type SetRoomPasswordReq
- type SetRoomSettingReq
- type SetUserPasswordReq
- type SetUsernameReq
- type SwapMovieReq
- type UserIDReq
- type UserInfoResp
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") ErrNameTooLong = errors.New("name too long") 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") 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 (
ErrInvalidID = errors.New("invalid id")
)
Functions ¶
Types ¶
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 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"` Setting dbModel.RoomSettings `json:"setting"` }
func (*CreateRoomReq) Validate ¶
func (c *CreateRoomReq) Validate() error
type CurrentMovieResp ¶ added in v0.3.0
type CurrentMovieResp struct { Status op.Status `json:"status"` Movie MoviesResp `json:"movie"` }
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 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 MoviesResp ¶ added in v0.3.0
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 RoomListResp ¶
type RoomUsersResp ¶ added in v0.3.0
type RoomUsersResp struct { UserID string `json:"userId"` Username string `json:"username"` Role dbModel.Role `json:"role"` JoinAt int64 `json:"joinAt"` RoomID string `json:"roomId"` Status dbModel.RoomUserStatus `json:"status"` Permissions dbModel.RoomUserPermission `json:"permissions"` }
type SetRoomPasswordReq ¶
type SetRoomPasswordReq struct {
Password string `json:"password"`
}
func (*SetRoomPasswordReq) Validate ¶
func (s *SetRoomPasswordReq) Validate() error
type SetRoomSettingReq ¶ added in v0.3.0
type SetRoomSettingReq dbModel.RoomSettings
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
Click to show internal directories.
Click to hide internal directories.