Documentation ¶
Index ¶
- type Actionable
- type AddNewComment
- type AssignUnassignTag
- type ChangeUserEmail
- func (action *ChangeUserEmail) GetEmail() string
- func (action *ChangeUserEmail) GetKind() enum.EmailVerificationKind
- func (action *ChangeUserEmail) GetName() string
- func (action *ChangeUserEmail) GetUser() *entity.User
- func (action *ChangeUserEmail) IsAuthorized(ctx context.Context, user *entity.User) bool
- func (action *ChangeUserEmail) Validate(ctx context.Context, user *entity.User) *validate.Result
- type ChangeUserRole
- type CompleteProfile
- type CreateEditOAuthConfig
- type CreateEditTag
- type CreateEditWebhook
- type CreateNewPost
- type CreateTenant
- func (action *CreateTenant) GetEmail() string
- func (action *CreateTenant) GetKind() enum.EmailVerificationKind
- func (action *CreateTenant) GetName() string
- func (action *CreateTenant) GetUser() *entity.User
- func (action *CreateTenant) IsAuthorized(ctx context.Context, user *entity.User) bool
- func (action *CreateTenant) Validate(ctx context.Context, user *entity.User) *validate.Result
- type CreateUser
- type DeleteComment
- type DeletePost
- type DeleteTag
- type EditComment
- type GenerateCheckoutLink
- type GitHubIssue
- type InviteUsers
- type PreExecuteAction
- type PreviewWebhook
- type SetResponse
- type SignInByEmail
- func (action *SignInByEmail) GetEmail() string
- func (action *SignInByEmail) GetKind() enum.EmailVerificationKind
- func (action *SignInByEmail) GetName() string
- func (action *SignInByEmail) GetUser() *entity.User
- func (action *SignInByEmail) IsAuthorized(ctx context.Context, user *entity.User) bool
- func (action *SignInByEmail) Validate(ctx context.Context, user *entity.User) *validate.Result
- type UpdatePost
- type UpdateTenantAdvancedSettings
- type UpdateTenantEmailAuthAllowed
- type UpdateTenantGitHubIntegration
- type UpdateTenantGitHubSettings
- type UpdateTenantPrivacy
- type UpdateTenantSettings
- type UpdateUserSettings
- type UserInvitation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actionable ¶
type Actionable interface { IsAuthorized(ctx context.Context, user *entity.User) bool Validate(ctx context.Context, user *entity.User) *validate.Result }
Actionable is any action that the user can perform using the web app
type AddNewComment ¶
type AddNewComment struct { Number int `route:"number"` Content string `json:"content"` Attachments []*dto.ImageUpload `json:"attachments"` }
AddNewComment represents a new comment to be added
func (*AddNewComment) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type AssignUnassignTag ¶
type AssignUnassignTag struct { Slug string `route:"slug"` Number int `route:"number"` Tag *entity.Tag Post *entity.Post }
AssignUnassignTag is used to assign or remove a tag to/from an post
func (*AssignUnassignTag) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type ChangeUserEmail ¶
type ChangeUserEmail struct { Email string `json:"email" format:"lower"` VerificationKey string Requestor *entity.User }
ChangeUserEmail is the action used to change current user's email
func NewChangeUserEmail ¶
func NewChangeUserEmail() *ChangeUserEmail
func (*ChangeUserEmail) GetEmail ¶
func (action *ChangeUserEmail) GetEmail() string
GetEmail returns the email being verified
func (*ChangeUserEmail) GetKind ¶
func (action *ChangeUserEmail) GetKind() enum.EmailVerificationKind
GetKind returns EmailVerificationKindSignIn
func (*ChangeUserEmail) GetName ¶
func (action *ChangeUserEmail) GetName() string
GetName returns empty for this kind of process
func (*ChangeUserEmail) GetUser ¶
func (action *ChangeUserEmail) GetUser() *entity.User
GetUser returns the current user performing this action
func (*ChangeUserEmail) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type ChangeUserRole ¶
ChangeUserRole is the input model change role of an user
func (*ChangeUserRole) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type CompleteProfile ¶
type CompleteProfile struct { Kind enum.EmailVerificationKind `json:"kind"` Key string `json:"key"` Name string `json:"name"` }
CompleteProfile happens when users completes their profile during first time sign in
func (*CompleteProfile) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type CreateEditOAuthConfig ¶
type CreateEditOAuthConfig struct { ID int Logo *dto.ImageUpload `json:"logo"` Provider string `json:"provider"` Status int `json:"status"` DisplayName string `json:"displayName"` ClientID string `json:"clientID"` ClientSecret string `json:"clientSecret"` AuthorizeURL string `json:"authorizeURL"` ImageURL string `json:"imageURL"` TokenURL string `json:"tokenURL"` Scope string `json:"scope"` ProfileURL string `json:"profileURL"` IsTrusted bool `json:"isTrusted"` JSONUserIDPath string `json:"jsonUserIDPath"` JSONUserNamePath string `json:"jsonUserNamePath"` JSONUserEmailPath string `json:"jsonUserEmailPath"` }
CreateEditOAuthConfig is used to create/edit OAuth config
func NewCreateEditOAuthConfig ¶
func NewCreateEditOAuthConfig() *CreateEditOAuthConfig
func (*CreateEditOAuthConfig) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type CreateEditTag ¶
type CreateEditTag struct { Slug string `route:"slug"` Name string `json:"name"` Color string `json:"color" format:"upper"` IsPublic bool `json:"isPublic"` Tag *entity.Tag }
CreateEditTag is used to create a new tag or edit existing
func (*CreateEditTag) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type CreateEditWebhook ¶
type CreateEditWebhook struct { Name string `json:"name"` Type enum.WebhookType `json:"type"` Status enum.WebhookStatus `json:"status"` Url string `json:"url"` Content string `json:"content"` HttpMethod string `json:"http_method"` HttpHeaders entity.HttpHeaders `json:"http_headers"` }
func (*CreateEditWebhook) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type CreateNewPost ¶
type CreateNewPost struct { Title string `json:"title"` Description string `json:"description"` Attachments []*dto.ImageUpload `json:"attachments"` }
CreateNewPost is used to create a new post
func (*CreateNewPost) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type CreateTenant ¶
type CreateTenant struct { Token string `json:"token"` Name string `json:"name"` Email string `json:"email" format:"lower"` VerificationKey string TenantName string `json:"tenantName"` LegalAgreement bool `json:"legalAgreement"` Subdomain string `json:"subdomain" format:"lower"` UserClaims *jwt.OAuthClaims }
CreateTenant is the input model used to create a tenant
func NewCreateTenant ¶
func NewCreateTenant() *CreateTenant
func (*CreateTenant) GetEmail ¶
func (action *CreateTenant) GetEmail() string
GetEmail returns the email being verified
func (*CreateTenant) GetKind ¶
func (action *CreateTenant) GetKind() enum.EmailVerificationKind
GetKind returns EmailVerificationKindSignUp
func (*CreateTenant) GetName ¶
func (action *CreateTenant) GetName() string
GetName returns the name of the email owner
func (*CreateTenant) GetUser ¶
func (action *CreateTenant) GetUser() *entity.User
GetUser returns the current user performing this action
func (*CreateTenant) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type CreateUser ¶
type CreateUser struct { Name string `json:"name"` Email string `json:"email"` Reference string `json:"reference"` }
CreateUser is the action to create a new user
func (*CreateUser) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type DeleteComment ¶
DeleteComment represents the action of deleting an existing comment
func (*DeleteComment) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type DeletePost ¶
DeletePost represents the action of an administrator deleting an existing Post
func (*DeletePost) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type DeleteTag ¶
DeleteTag is used to delete an existing tag
func (*DeleteTag) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type EditComment ¶
type EditComment struct { PostNumber int `route:"number"` ID int `route:"id"` Content string `json:"content"` Attachments []*dto.ImageUpload `json:"attachments"` Post *entity.Post Comment *entity.Comment }
EditComment represents the action to update an existing comment
func (*EditComment) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type GenerateCheckoutLink ¶
type GenerateCheckoutLink struct {
PlanID string `json:"planId"`
}
GenerateCheckoutLink is used to generate a Paddle-hosted checkout link for the service subscription
func (*GenerateCheckoutLink) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type GitHubIssue ¶
type GitHubIssue struct { RepoID int `json:"repoid"` PostID int `route:"postid"` Title string `json:"postTitle"` Body string `json:"postBody"` }
func (*GitHubIssue) IsAuthorized ¶
type InviteUsers ¶
type InviteUsers struct { Subject string `json:"subject"` Message string `json:"message"` Recipients []string `json:"recipients" format:"lower"` IsSampleInvite bool Invitations []*UserInvitation }
InviteUsers is used to invite new users into Templates
func (*InviteUsers) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type PreExecuteAction ¶
PreExecuteAction can add custom pre processing logic for any action OnPreExecute is executed before IsAuthorized and Validate
type PreviewWebhook ¶
type PreviewWebhook struct { Type enum.WebhookType `json:"type"` Url string `json:"url"` Content string `json:"content"` }
func (*PreviewWebhook) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type SetResponse ¶
type SetResponse struct { Number int `route:"number"` Status enum.PostStatus `json:"status"` Text string `json:"text"` OriginalNumber int `json:"originalNumber"` Original *entity.Post }
SetResponse represents the action to update an post response
func (*SetResponse) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type SignInByEmail ¶
SignInByEmail happens when user request to sign in by email
func NewSignInByEmail ¶
func NewSignInByEmail() *SignInByEmail
func (*SignInByEmail) GetEmail ¶
func (action *SignInByEmail) GetEmail() string
GetEmail returns the email being verified
func (*SignInByEmail) GetKind ¶
func (action *SignInByEmail) GetKind() enum.EmailVerificationKind
GetKind returns EmailVerificationKindSignIn
func (*SignInByEmail) GetName ¶
func (action *SignInByEmail) GetName() string
GetName returns empty for this kind of process
func (*SignInByEmail) GetUser ¶
func (action *SignInByEmail) GetUser() *entity.User
GetUser returns the current user performing this action
func (*SignInByEmail) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type UpdatePost ¶
type UpdatePost struct { Number int `route:"number"` Title string `json:"title"` Description string `json:"description"` Attachments []*dto.ImageUpload `json:"attachments"` Post *entity.Post }
UpdatePost is used to edit an existing new post
func (*UpdatePost) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
func (*UpdatePost) OnPreExecute ¶
func (input *UpdatePost) OnPreExecute(ctx context.Context) error
OnPreExecute prefetches Post for later use
type UpdateTenantAdvancedSettings ¶
type UpdateTenantAdvancedSettings struct {
CustomCSS string `json:"customCSS"`
}
UpdateTenantAdvancedSettings is the input model used to update tenant advanced settings
func (*UpdateTenantAdvancedSettings) IsAuthorized ¶
func (action *UpdateTenantAdvancedSettings) IsAuthorized(ctx context.Context, user *entity.User) bool
IsAuthorized returns true if current user is authorized to perform this action
type UpdateTenantEmailAuthAllowed ¶
type UpdateTenantEmailAuthAllowed struct {
IsEmailAuthAllowed bool `json:"isEmailAuthAllowed"`
}
UpdateTenantEmailAuthAllowed is the input model used to update tenant privacy settings
func (*UpdateTenantEmailAuthAllowed) IsAuthorized ¶
func (action *UpdateTenantEmailAuthAllowed) IsAuthorized(ctx context.Context, user *entity.User) bool
IsAuthorized returns true if current user is authorized to perform this action
type UpdateTenantGitHubIntegration ¶
type UpdateTenantGitHubIntegration struct {
IsGitHubEnabled bool `json:"isGitHubEnabled"`
}
func (*UpdateTenantGitHubIntegration) IsAuthorized ¶
type UpdateTenantGitHubSettings ¶
type UpdateTenantGitHubSettings struct { Token string `json:"token"` Repo string `json:"repo"` Owner string `json:"owner"` ID int `route:"id"` }
This specifies the HTTP post format the JSON is in. The JSON ID must reflect what is being passed from the tsx page.
func (*UpdateTenantGitHubSettings) IsAuthorized ¶
type UpdateTenantPrivacy ¶
type UpdateTenantPrivacy struct {
IsPrivate bool `json:"isPrivate"`
}
UpdateTenantPrivacy is the input model used to update tenant privacy settings
func (*UpdateTenantPrivacy) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type UpdateTenantSettings ¶
type UpdateTenantSettings struct { Logo *dto.ImageUpload `json:"logo"` Title string `json:"title"` Invitation string `json:"invitation"` WelcomeMessage string `json:"welcomeMessage"` Locale string `json:"locale"` CNAME string `json:"cname" format:"lower"` }
UpdateTenantSettings is the input model used to update tenant settings
func NewUpdateTenantSettings ¶
func NewUpdateTenantSettings() *UpdateTenantSettings
func (*UpdateTenantSettings) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type UpdateUserSettings ¶
type UpdateUserSettings struct { Name string `json:"name"` AvatarType enum.AvatarType `json:"avatarType"` Avatar *dto.ImageUpload `json:"avatar"` Settings map[string]string `json:"settings"` }
UpdateUserSettings happens when users updates their settings
func NewUpdateUserSettings ¶
func NewUpdateUserSettings() *UpdateUserSettings
func (*UpdateUserSettings) IsAuthorized ¶
IsAuthorized returns true if current user is authorized to perform this action
type UserInvitation ¶
UserInvitation is the model used to register an invite sent to an user
func (*UserInvitation) GetEmail ¶
func (e *UserInvitation) GetEmail() string
GetEmail returns the invited user's email
func (*UserInvitation) GetKind ¶
func (e *UserInvitation) GetKind() enum.EmailVerificationKind
GetKind returns EmailVerificationKindUserInvitation
func (*UserInvitation) GetName ¶
func (e *UserInvitation) GetName() string
GetName returns empty for this kind of process
func (*UserInvitation) GetUser ¶
func (e *UserInvitation) GetUser() *entity.User
GetUser returns the current user performing this action