Documentation ¶
Index ¶
- Variables
- func AddXPoweredByHeader(c *fiber.Ctx) error
- func AdminMiddleware(c *fiber.Ctx) error
- func ApiKeyMiddleware(c *fiber.Ctx) error
- func AuthMiddleware(c *fiber.Ctx) error
- func IsFileOwnerMiddleware(c *fiber.Ctx) error
- func IsGameRequestMiddleware(c *fiber.Ctx) error
- func LoginMiddleware(c *fiber.Ctx) error
- func Main()
- func MfaMiddleware()
- type AddTagsRequest
- type CreateAvatarRequest
- type CreateFileRequest
- type CreateFileVersionRequest
- type CreateWorldRequest
- type HealthStatus
- type HealthStatusDetails
- type ModerationRequest
- type PlayerModerationRequest
- type PutVisitsRequest
- type RegisterRequest
- type RemoveTagsRequest
- type UpdateUserRequest
- func (r *UpdateUserRequest) BioChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) BioLinksChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) EmailChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) HomeLocationChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) PasswordChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) ProfilePicOverrideChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) StatusChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) StatusDescriptionChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) TagsChecks(u *models.User) (bool, error)
- func (r *UpdateUserRequest) UserIconChecks(u *models.User) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DiscoveryService *discovery_client.Discovery
View Source
var FilesService pb.FileClient
View Source
var PhotonCustomAuthFailedResponse = fiber.Map{"ResultCode": 2}
View Source
var PhotonCustomAuthSuccessResponse = fiber.Map{"ResultCode": 1}
View Source
var PhotonInvalidParametersResponse = fiber.Map{"ResultCode": 3}
View Source
var ValidLanguageTags = []string{"eng", "kor", "rus", "spa", "por", "zho", "deu", "jpn", "fra", "swe", "nld", "pol", "dan", "nor", "ita", "tha", "fin", "hun", "ces", "tur", "ara", "ron", "vie", "ukr", "ase", "bfi", "dse", "fsl", "kvk"}
Functions ¶
func AddXPoweredByHeader ¶
func AddXPoweredByHeader(c *fiber.Ctx) error
AddXPoweredByHeader adds an `X-Powered-By` header to every response with a randomly-selected string from the models.XPoweredByHeaders slice.
func AdminMiddleware ¶
func AdminMiddleware(c *fiber.Ctx) error
func ApiKeyMiddleware ¶
func ApiKeyMiddleware(c *fiber.Ctx) error
ApiKeyMiddleware ensures that the request has a valid API key attached.
func AuthMiddleware ¶
func AuthMiddleware(c *fiber.Ctx) error
func IsFileOwnerMiddleware ¶
func IsFileOwnerMiddleware(c *fiber.Ctx) error
func IsGameRequestMiddleware ¶
func IsGameRequestMiddleware(c *fiber.Ctx) error
IsGameRequestMiddleware uses the `X-Requested-With`, `X-MacAddress`, `X-Client-Version`, `X-Platform`, and `User-Agent` headers to identify whether a request is coming from the game client or not.
More specifically; for the request to be marked as a game request:
>X-Requested-With must be present >X-MacAddress must be present >X-Client-Version must be present >X-Platform must be present and one of ["standalonewindows", "android"] >User-Agent must be present and one of ["VRC.Core.BestHTTP", "Transmtn-Pipeline"]
func LoginMiddleware ¶
func LoginMiddleware(c *fiber.Ctx) error
LoginMiddleware logs a user in if there's an Authorization header present in the request.
func MfaMiddleware ¶
func MfaMiddleware()
Types ¶
type AddTagsRequest ¶
type AddTagsRequest struct {
Tags []string `json:"tags"`
}
func (*AddTagsRequest) TagsChecks ¶
func (r *AddTagsRequest) TagsChecks(u *models.User) (bool, error)
type CreateAvatarRequest ¶
type CreateAvatarRequest struct { ID string `json:"id"` AssetUrl string `json:"assetUrl"` AssetVersion string `json:"assetVersion"` AuthorId string `json:"authorId"` AuthorName string `json:"authorName"` CreatedAt string `json:"created_at"` Description string `json:"description"` ImageUrl string `json:"imageUrl"` Name string `json:"name"` Platform models.Platform `json:"platform"` ReleaseStatus models.ReleaseStatus `json:"releaseStatus"` Tags []string `json:"tags"` TotalLikes string `json:"totalLikes"` TotalVisits string `json:"totalVisits"` UnityVersion string `json:"unityVersion"` UpdatedAt string `json:"updated_at"` }
func (*CreateAvatarRequest) GetFileID ¶
func (r *CreateAvatarRequest) GetFileID() (string, error)
func (*CreateAvatarRequest) GetFileVersion ¶
func (r *CreateAvatarRequest) GetFileVersion() (int, error)
func (*CreateAvatarRequest) GetImageID ¶
func (r *CreateAvatarRequest) GetImageID() (string, error)
func (*CreateAvatarRequest) HasValidUrls ¶
func (r *CreateAvatarRequest) HasValidUrls() bool
func (*CreateAvatarRequest) ParseTags ¶
func (r *CreateAvatarRequest) ParseTags() []string
type CreateFileRequest ¶
type CreateWorldRequest ¶
type CreateWorldRequest struct { ID string `json:"id"` AssetUrl string `json:"assetUrl"` AssetVersion int `json:"assetVersion"` AuthorId string `json:"authorId"` AuthorName string `json:"authorName"` Capacity int `json:"capacity"` CreatedAt string `json:"created_at"` Description string `json:"description"` ImageUrl string `json:"imageUrl"` Name string `json:"name"` Platform models.Platform `json:"platform"` ReleaseStatus models.ReleaseStatus `json:"releaseStatus"` Tags []string `json:"tags"` TotalLikes string `json:"totalLikes"` TotalVisits string `json:"totalVisits"` UnityVersion string `json:"unityVersion"` UpdatedAt string `json:"updated_at"` }
func (*CreateWorldRequest) GetFileID ¶
func (r *CreateWorldRequest) GetFileID() (string, error)
func (*CreateWorldRequest) GetFileVersion ¶
func (r *CreateWorldRequest) GetFileVersion() (int, error)
func (*CreateWorldRequest) GetImageID ¶
func (r *CreateWorldRequest) GetImageID() (string, error)
func (*CreateWorldRequest) HasValidUrls ¶
func (r *CreateWorldRequest) HasValidUrls() bool
func (*CreateWorldRequest) ParseTags ¶
func (r *CreateWorldRequest) ParseTags() []string
type HealthStatus ¶
type HealthStatus struct { Files HealthStatusDetails `json:"files"` Redis HealthStatusDetails `json:"redis"` Config HealthStatusDetails `json:"config"` Postgres HealthStatusDetails `json:"postgres"` }
type HealthStatusDetails ¶
type ModerationRequest ¶
type ModerationRequest struct { CreatedAt string `json:"created"` ExpiresAt string `json:"expires"` Type models.ModerationType `json:"type"` Reason string `json:"reason"` IsPermanent string `json:"isPermanent"` // What the fuck, why??? TargetID string `json:"targetUserId"` WorldID string `json:"worldId"` InstanceID string `json:"instanceId"` }
type PlayerModerationRequest ¶
type PlayerModerationRequest struct { Against string `json:"moderated"` Type models.PlayerModerationType `json:"type"` }
type PutVisitsRequest ¶
type RegisterRequest ¶
type RegisterRequest struct { AcceptedTOSVersion int `json:"acceptedTOSVersion"` Username string `json:"username"` Password string `json:"password"` Email string `json:"email"` Day string `json:"day"` Month string `json:"month"` Year string `json:"year"` RecaptchaCode string `json:"recaptchaCode"` }
RegisterRequest is the model for requests sent to /auth/register.
type RemoveTagsRequest ¶
type RemoveTagsRequest struct {
Tags []string `json:"tags"`
}
func (*RemoveTagsRequest) TagsChecks ¶
func (r *RemoveTagsRequest) TagsChecks(u *models.User) (bool, error)
type UpdateUserRequest ¶
type UpdateUserRequest struct { AcceptedTOSVersion int `json:"acceptedTOSVersion"` Bio string `json:"bio"` BioLinks []string `json:"bioLinks"` Birthday string `json:"birthday"` CurrentPassword string `json:"currentPassword"` DisplayName string `json:"displayName"` Email string `json:"email"` Password string `json:"password"` ProfilePictureOverride string `json:"profilePicOverride"` Status string `json:"status"` StatusDescription string `json:"statusDescription"` Tags []string `json:"tags"` Unsubscribe bool `json:"unsubscribe"` UserIcon string `json:"userIcon"` HomeLocation string `json:"homeLocation"` }
func (*UpdateUserRequest) BioChecks ¶
func (r *UpdateUserRequest) BioChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) BioLinksChecks ¶
func (r *UpdateUserRequest) BioLinksChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) EmailChecks ¶
func (r *UpdateUserRequest) EmailChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) HomeLocationChecks ¶
func (r *UpdateUserRequest) HomeLocationChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) PasswordChecks ¶
func (r *UpdateUserRequest) PasswordChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) ProfilePicOverrideChecks ¶
func (r *UpdateUserRequest) ProfilePicOverrideChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) StatusChecks ¶
func (r *UpdateUserRequest) StatusChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) StatusDescriptionChecks ¶
func (r *UpdateUserRequest) StatusDescriptionChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) TagsChecks ¶
func (r *UpdateUserRequest) TagsChecks(u *models.User) (bool, error)
func (*UpdateUserRequest) UserIconChecks ¶
func (r *UpdateUserRequest) UserIconChecks(u *models.User) (bool, error)
Click to show internal directories.
Click to hide internal directories.