Documentation
¶
Index ¶
- func AuthInjectorMiddleware(ctx *fiber.Ctx) error
- func AuthMiddleware(ctx *fiber.Ctx) error
- func BotMiddleware(ctx *fiber.Ctx) error
- func CORSMiddleware(h http.Handler) http.Handler
- func CreateToken(sub string, userInfo IProvider) (string, error)
- func ErrorResponse(ctx *fiber.Ctx, code int, err error, isManual bool) error
- func GetCallbackURL(provider string) string
- func JSONMiddleware(h http.Handler) http.Handler
- func ProfileMiddleware(ctx *fiber.Ctx) error
- func RandInt(min int, max int) int
- func RandomWord() string
- func WorkspaceIntegrationMiddleware(ctx *fiber.Ctx) error
- func WorkspaceMemberMiddleware(ctx *fiber.Ctx) error
- func WorkspaceMiddleware(ctx *fiber.Ctx) error
- type DocsAPIError
- type IBlacklist
- type IBot
- type IBotActivity
- type IBotAnalytics
- type IBotCommand
- type IBotModerationAction
- type IBotModule
- type IBotModules
- type IBotPermissions
- type IBotSettings
- type IDiscordApiUser
- type IIdentityData
- type IIntegration
- type IIntegrationData
- type IIntegrationSchema
- type IIntegrationSchemaInput
- type IPlan
- type IProfile
- type IProvider
- type IRegion
- type IRobloxIntegration
- type IRobloxIntegrationBadActorDetection
- type IRobloxIntegrationMemberCounter
- type IRobloxIntegrationShoutProxy
- type IRobloxIntegrationWallFilter
- type IRobloxSchema
- type IRobloxSchemaBadActorDetection
- type IRobloxSchemaFactors
- type IRobloxSchemaMemberCounter
- type IRobloxSchemaShoutProxy
- type IRobloxSchemaWallFilter
- type IStatistic
- type ITeamMember
- type ITeamMemberUser
- type IWorkspace
- type IWorkspaceIntegration
- type IWorkspaceMember
- type IWorkspaceMemberWithoutProfile
- type OrderedMap
- type Response
- type String
- type UserClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthInjectorMiddleware ¶
Injects user if the user exists
func AuthMiddleware ¶
func BotMiddleware ¶
func GetCallbackURL ¶
func ProfileMiddleware ¶
func RandomWord ¶
func RandomWord() string
func WorkspaceMiddleware ¶
Types ¶
type DocsAPIError ¶
type IBlacklist ¶
type IBlacklist struct {
ID int8 `json:"id"`
CreatedAt time.Time `json:"created_at"`
Moderator string `json:"moderator"`
User string `json:"user"`
DiscordID string `json:"discord_id"`
Reason string `json:"reason"`
Expires bool `json:"expires"`
Expiry time.Time `json:"expiry"`
Flags interface{} `json:"flags"`
FactorMatching []string `json:"factor_matching"`
Notes string `json:"notes"`
}
type IBot ¶
type IBot struct {
ID *string `json:"id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Region string `json:"region" form:"region"`
Owner *string `json:"owner,omitempty"`
Workspace *IWorkspace `json:"workspace,omitempty"`
Settings IBotSettings `json:"settings" form:"settings"`
Token string `json:"token" form:"token"`
Commands []IBotCommand `json:"commands" form:"commands"`
Permissions IBotPermissions `json:"permissions" form:"permissions"`
}
type IBotActivity ¶
type IBotAnalytics ¶
type IBotCommand ¶
type IBotModerationAction ¶
type IBotModerationAction struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
Bot string `json:"bot"`
Guild string `json:"guild"`
Action string `json:"action"`
Moderator string `json:"moderator"`
Reason string `json:"reason"`
Expires bool `json:"expires"`
Expiry time.Time `json:"expiry"`
User string `json:"user"`
}
type IBotModule ¶
type IBotModules ¶
type IBotModules struct {
Fun IBotModule[any] `json:"fun"`
Moderation IBotModule[struct {
Logging struct {
Enabled bool `json:"enabled"`
Channel string `json:"channel"`
} `json:"logging"`
}] `json:"moderation"`
}
type IBotPermissions ¶
type IBotSettings ¶
type IBotSettings struct {
Guild string `json:"guild" form:"guild"`
Prefix string `json:"prefix" form:"prefix"`
Status string `json:"status" form:"status"`
Activities []IBotActivity `json:"activities" form:"activities"`
RandomizeActivities bool `json:"randomizeActivities" form:"randomizeActivities"`
ActivityInterval int `json:"activityInterval" form:"activityInterval"`
CurrentActivity int `json:"currentActivity"`
Modules IBotModules `json:"modules" form:"modules"`
}
type IDiscordApiUser ¶
type IDiscordApiUser struct {
ID string `json:"id"`
Username string `json:"username"`
Discriminator string `json:"discriminator"`
Avatar *string `json:"avatar,omitempty"`
Bot *bool `json:"bot,omitempty"`
System *bool `json:"system,omitempty"`
MFAEnabled *bool `json:"mfa_enabled,omitempty"`
Banner *string `json:"banner,omitempty"`
AccentColor *int `json:"accent_color,omitempty"`
Locale *string `json:"locale,omitempty"`
Verified *bool `json:"verified,omitempty"`
Email *string `json:"email,omitempty"`
Flags *int `json:"flags,omitempty"`
PremiumType *int `json:"premium_type,omitempty"`
PublicFlags *int `json:"public_flags,omitempty"`
}
type IIdentityData ¶
type IIdentityData struct {
Iss string `json:"iss"`
Sub string `json:"sub"`
Name string `json:"name"`
Email string `json:"email"`
Picture string `json:"picture"`
FullName string `json:"full_name"`
AvatarURL string `json:"avatar_url"`
ProviderID string `json:"provider_id"`
EmailVerified bool `json:"email_verified"`
}
type IIntegration ¶
type IIntegration struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
Name string `json:"name"`
PrettyName string `json:"prettyName"`
Icon string `json:"icon"`
IsIconSimpleIcon bool `json:"isIconSimpleIcon"`
Website string `json:"website"`
Enabled bool `json:"enabled"`
Description string `json:"description"`
Schema IIntegrationSchema `json:"schema"`
}
type IIntegrationData ¶
type IIntegrationSchema ¶
type IIntegrationSchema struct {
Type string `json:"type"`
Title string `json:"title"`
Properties OrderedMap `json:"properties"`
}
type IIntegrationSchemaInput ¶
type IProfile ¶
type IProfile struct {
ID string `json:"id"`
Email string `json:"email"`
PreferredName string `json:"preferred_name"`
IdentityData IIdentityData `json:"identity_data"`
Access string `json:"access"`
DiscordID string `json:"discord_id"`
RobloxID interface{} `json:"roblox_id"`
StripeCustomerID string `json:"stripe_customer_id"`
CreatedAt string `json:"created_at"`
Location string `json:"location"`
Language string `json:"language"`
Pronouns []string `json:"pronouns"`
Hireable bool `json:"hireable"`
About string `json:"about"`
Strengths []string `json:"strengths"`
Weaknesses []string `json:"weaknesses"`
Banner string `json:"banner"`
Verified bool `json:"verified"`
Public bool `json:"public"`
Workspaces []IWorkspace `json:"workspaces"`
}
type IProvider ¶
type IProvider struct {
ID *string `json:"id,omitempty"`
CreatedAt time.Time `json:"created_at"`
User string `json:"user"`
Type string `json:"type"`
ProviderID string `json:"provider_id"`
ProviderAccessToken string `json:"provider_access_token"`
ProviderRefreshToken string `json:"provider_refresh_token"`
ProviderData map[string]interface{} `json:"provider_data"`
ProviderExpiresAt *time.Time `json:"provider_expires_at,omitempty"`
ProviderAvatarUrl *string `json:"provider_avatar_url,omitempty"`
ProviderEmail *string `json:"provider_email,omitempty"`
}
type IRegion ¶
type IRegion struct {
ID string `json:"id"`
Flag string `json:"flag"`
IP string `json:"ip"`
City string `json:"city"`
Country string `json:"country"`
Region string `json:"region"`
PrettyName string `json:"prettyName"`
Lat float64 `json:"lat"`
Long float64 `json:"long"`
MaxBots int `json:"maxBots"`
Status string `json:"status"`
Bots int `json:"bots"`
}
type IRobloxIntegration ¶
type IRobloxIntegration struct {
GroupId string `json:"groupId" form:"groupId"`
Token string `json:"token" form:"token"`
MemberCounter IRobloxIntegrationMemberCounter `json:"memberCounter" form:"memberCounter"`
ShoutProxy IRobloxIntegrationShoutProxy `json:"shoutProxy" form:"shoutProxy"`
BadActorDetection IRobloxIntegrationBadActorDetection `json:"badActorDetection" form:"badActorDetection"`
WallFilter IRobloxIntegrationWallFilter `json:"wallFilter" form:"wallFilter"`
}
type IRobloxIntegrationBadActorDetection ¶
type IRobloxIntegrationBadActorDetection struct {
Enabled bool `json:"enabled" form:"enabled"`
Factors struct {
BannedGroups string `json:"bannedGroups" form:"bannedGroups"`
SketchyUsername bool `json:"sketchyUsername" form:"sketchyUsername"`
NoDescription bool `json:"noDescription" form:"noDescription"`
}
}
type IRobloxSchema ¶
type IRobloxSchema struct {
GroupId orderedjson.Map `json:"groupId"`
Token orderedjson.Map `json:"token"`
MemberCounter orderedjson.Map `json:"member_counter"`
ShoutProxy orderedjson.Map `json:"shout_proxy"`
BadActorDetection orderedjson.Map `json:"bad_actor_detection"`
WallFilter orderedjson.Map `json:"wall_filter"`
Submit orderedjson.Map `json:"submit"`
}
type IRobloxSchemaBadActorDetection ¶
type IRobloxSchemaBadActorDetection struct {
Enabled orderedjson.Map `json:"enabled"`
Factors orderedjson.Map `json:"factors"`
}
type IRobloxSchemaFactors ¶
type IRobloxSchemaFactors struct {
BannedGroups orderedjson.Map `json:"banned_groups"`
SketchyUsername orderedjson.Map `json:"sketchyUsername"`
NoDescription orderedjson.Map `json:"noDescription"`
}
type IRobloxSchemaMemberCounter ¶
type IRobloxSchemaMemberCounter struct {
Enabled orderedjson.Map `json:"enabled"`
Message orderedjson.Map `json:"message"`
Webhook orderedjson.Map `json:"webhook"`
GroupId orderedjson.Map `json:"groupId"`
}
type IRobloxSchemaShoutProxy ¶
type IRobloxSchemaShoutProxy struct {
Enabled orderedjson.Map `json:"enabled"`
Webhook orderedjson.Map `json:"webhook"`
GroupId orderedjson.Map `json:"groupId"`
}
type IRobloxSchemaWallFilter ¶
type IRobloxSchemaWallFilter struct {
BannedPhrases orderedjson.Map `json:"bannedPhrases"`
}
type IStatistic ¶
type ITeamMember ¶
type ITeamMemberUser ¶
type ITeamMemberUser struct {
IdentityData IIdentityData `json:"identity_data"`
}
type IWorkspace ¶
type IWorkspace struct {
ID *string `json:"id,omitempty"`
CreatedAt *string `json:"created_at,omitempty"`
Owner *string `json:"owner,omitempty"`
Members *[]string `json:"members,omitempty"`
GroupID *string `json:"group_id,omitempty"`
Name string `json:"name" form:"name"`
Logo string `json:"logo" form:"logo"`
Settings interface{} `json:"settings"`
Plan int64 `json:"plan" form:"plan"`
Visibility string `json:"visibility" form:"visibility"`
Integrations interface{} `json:"integrations"`
Pending bool `json:"pending"`
}
type IWorkspaceIntegration ¶
type IWorkspaceMember ¶
type OrderedMap ¶
func (OrderedMap) MarshalJSON ¶
func (om OrderedMap) MarshalJSON() ([]byte, error)
func (*OrderedMap) UnmarshalJSON ¶
func (om *OrderedMap) UnmarshalJSON(b []byte) error
type UserClaims ¶
type UserClaims struct {
UserInfo IProvider
*jwt.RegisteredClaims
}
func GetClaimsFromToken ¶
func GetClaimsFromToken(tokenString string) (UserClaims, error)
Click to show internal directories.
Click to hide internal directories.