Documentation ¶
Index ¶
- Variables
- func Between(v, from, to int64) bool
- func ErrInvalidParam(param string) error
- func ErrRequiredParam(param string) error
- func ErrUnsupported[T any](param string, value T) error
- func HandlePayload[M any](ctx context.Context, evt *event.Event, ...) error
- func Truncate(s string, n int) string
- type Publisher
- type Service
- func (s *Service) AddAppPermission(ctx context.Context, appID, permissionID string) error
- func (s *Service) AddAppScore(ctx context.Context, appID string, score int64) error
- func (s *Service) AddAppSubscription(ctx context.Context, appID, subscriptionID string) error
- func (s *Service) AddAppTag(ctx context.Context, appID, tagID string) error
- func (s *Service) CreateApp(ctx context.Context, in model.CreateAppInput) (model.App, error)
- func (s *Service) CreateAppReview(ctx context.Context, in model.CreateAppReviewInput) (model.AppReview, error)
- func (s *Service) DeleteApp(ctx context.Context, appID string) error
- func (s *Service) DeleteAppReview(ctx context.Context, reviewID string) error
- func (s *Service) DeleteAppToken(ctx context.Context, tokenID string) error
- func (s *Service) DisableAppByDefault(ctx context.Context, appID string) error
- func (s *Service) DisableAppInCircle(ctx context.Context, circleID, appID string) (err error)
- func (s *Service) DownvoteAppReview(ctx context.Context, reviewID string) error
- func (s *Service) EnableAppByDefault(ctx context.Context, appID string) error
- func (s *Service) EnableAppInCircle(ctx context.Context, appID, circleID string) error
- func (s *Service) EnableAppInCircles(ctx context.Context, appID string, circleIDs ...string) error
- func (s *Service) EnableAppsInCircle(ctx context.Context, circleID string, appIDs ...string) error
- func (s *Service) FeatureApp(ctx context.Context, appID string) error
- func (s *Service) GenerateAppToken(ctx context.Context, appID, name string) (model.GeneratedToken, error)
- func (s *Service) GenerateUserScopedAppToken(ctx context.Context, appID string) (model.GeneratedToken, error)
- func (s *Service) GetApp(ctx context.Context, id string) (model.App, error)
- func (s *Service) GetAppCounters(ctx context.Context, id string) (model.AppCounters, error)
- func (s *Service) GetAppLastUsedAt(ctx context.Context, appID string) (*time.Time, error)
- func (s *Service) GetAppPermissions(ctx context.Context, appID string) ([]model.Permission, error)
- func (s *Service) GetAppReview(ctx context.Context, id string) (model.AppReview, error)
- func (s *Service) GetAppReviews(ctx context.Context, appID string, c model.Cursor) ([]model.AppReview, cursor.Page, error)
- func (s *Service) GetAppReviewsByUser(ctx context.Context, appID string) ([]model.AppReview, error)
- func (s *Service) GetAppSavedAt(ctx context.Context, appID string) (*time.Time, error)
- func (s *Service) GetAppSubscriptions(ctx context.Context, appID string) ([]model.Subscription, error)
- func (s *Service) GetAppTags(ctx context.Context, appID string) ([]model.Tag, error)
- func (s *Service) GetAppTokens(ctx context.Context, appID string) ([]model.AppToken, error)
- func (s *Service) GetAppUpvotedAt(ctx context.Context, appID string) (*time.Time, error)
- func (s *Service) GetApps(ctx context.Context, ids ...string) ([]model.App, error)
- func (s *Service) GetAppsEnabledByDefault(ctx context.Context, f model.GetDefaultAppsFilter) ([]model.App, cursor.Page, error)
- func (s *Service) GetCircleApps(ctx context.Context, appID, circleID string, c *model.Cursor) ([]model.CircleApp, cursor.Page, error)
- func (s *Service) GetDefaultPermissions() []model.Permission
- func (s *Service) GetEnabledApps(ctx context.Context, ids ...string) ([]model.App, error)
- func (s *Service) GetFeaturedApps(ctx context.Context, f model.GetFeaturedAppsFilter) ([]model.App, cursor.Page, error)
- func (s *Service) GetLastUsedApps(ctx context.Context, c model.Cursor) ([]model.App, cursor.Page, error)
- func (s *Service) GetMyApps(ctx context.Context) ([]model.App, error)
- func (s *Service) GetPermissions(ctx context.Context, ids ...string) ([]model.Permission, error)
- func (s *Service) GetSavedApps(ctx context.Context, f model.GetSavedAppsFilter) ([]model.App, cursor.Page, error)
- func (s *Service) GetSubscriptions(ctx context.Context, ids ...string) ([]model.Subscription, error)
- func (s *Service) GetTags(ctx context.Context, ids ...string) ([]model.Tag, error)
- func (s *Service) GrantAppPermissionsInCircle(ctx context.Context, appID, circleID string, permIDs ...string) (err error)
- func (s *Service) GrantAppSubscriptionsInCircle(ctx context.Context, appID, circleID string, subIDs ...string) (err error)
- func (s *Service) HandleAppEvent(ctx context.Context, evt *event.Event) error
- func (s *Service) HandleAppPermissionAdded(ctx context.Context, appID, permissionID, userID string) (err error)
- func (s *Service) HandleAppSubscription(ctx context.Context, e model.AppSubscriptionEvent) error
- func (s *Service) HandleAppSubscriptionAdded(ctx context.Context, appID, subscriptionID, userID string) error
- func (s *Service) HandleChatEvent(ctx context.Context, evt *event.Event) error
- func (s *Service) HandleCircleCommentCreated(ctx context.Context, eventID, circleID, commentID, userID string) error
- func (s *Service) HandleCircleCreated(ctx context.Context, circleID, userID string) (err error)
- func (s *Service) HandleCircleDeleted(ctx context.Context, circleID, userID string, deletedAt time.Time) error
- func (s *Service) HandleCircleEvent(ctx context.Context, evt *event.Event) error
- func (s *Service) HandleCircleMessageSent(ctx context.Context, eventID, circleID, messageID, userID string) error
- func (s *Service) HandleCirclePostCreated(ctx context.Context, eventID, circleID, postID, userID string) error
- func (s *Service) HandleCommentEvent(ctx context.Context, evt *event.Event) error
- func (s *Service) HandleContentEvent(ctx context.Context, evt *event.Event) error
- func (s *Service) HandleDefaultAppCreated(ctx context.Context, appID, userID string) error
- func (s *Service) HandleUserJoinedCircle(ctx context.Context, eventID, circleID, userID string) error
- func (s *Service) HandleUserLeftCircle(ctx context.Context, eventID, circleID, userID string) error
- func (s *Service) IssueAppToken(ctx context.Context, tokenID string) (model.IssuedToken, error)
- func (s *Service) RemoveAppPermission(ctx context.Context, appID, permissionID string) error
- func (s *Service) RemoveAppSubscription(ctx context.Context, appID, subscriptionID string) error
- func (s *Service) RemoveAppTag(ctx context.Context, appID, tagID string) error
- func (s *Service) RevokeAppPermissionsInCircle(ctx context.Context, appID, circleID string, permIDs ...string) (err error)
- func (s *Service) RevokeAppSubscriptionsInCircle(ctx context.Context, appID, circleID string, subIDs ...string) (err error)
- func (s *Service) RevokeAppToken(ctx context.Context, tokenID string) error
- func (s *Service) SaveApp(ctx context.Context, appID string) error
- func (s *Service) SearchApps(ctx context.Context, f model.SearchAppsFilter) ([]model.App, cursor.Page, error)
- func (s *Service) Subscribe(ctx context.Context, client eventbus.Client) error
- func (s *Service) UndownvoteAppReview(ctx context.Context, reviewID string) error
- func (s *Service) UnfeatureApp(ctx context.Context, appID string) error
- func (s *Service) UnsaveApp(ctx context.Context, appID string) error
- func (s *Service) UnupvoteApp(ctx context.Context, appID string) error
- func (s *Service) UnupvoteAppReview(ctx context.Context, reviewID string) error
- func (s *Service) UpdateApp(ctx context.Context, appID string, in model.UpdateAppInput) error
- func (s *Service) UpvoteApp(ctx context.Context, appID string) error
- func (s *Service) UpvoteAppReview(ctx context.Context, reviewID string) error
- func (s *Service) ValidateAppCreateInput(ctx context.Context, input model.CreateAppInput) (err error)
- func (s *Service) ValidateAppDescription(_ context.Context, name string) error
- func (s *Service) ValidateAppImageURL(_ context.Context, u string) error
- func (s *Service) ValidateAppName(_ context.Context, name string) error
- func (s *Service) ValidateAppReviewRating(_ context.Context, rating int64) error
- func (s *Service) ValidateAppURL(_ context.Context, u string) error
- func (s *Service) ValidateAppWebhookURL(_ context.Context, u string) error
- func (s *Service) ValidateCreateAppReviewInput(ctx context.Context, in model.CreateAppReviewInput) (err error)
- func (s *Service) ValidatePermissionID(_ context.Context, id string) error
- func (s *Service) ValidateSubscriptionID(_ context.Context, id string) error
- func (s *Service) ValidateTagID(_ context.Context, id string) error
- func (s *Service) ValidateUpdateInput(ctx context.Context, in model.UpdateAppInput) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAppNotFound = status.Error(codes.NotFound, "app not found") ErrAppDeleted = status.Error(codes.NotFound, "app was deleted") ErrNotAllowedToModifyApp = status.Errorf( codes.PermissionDenied, "you are not allowed to modify this application", ) ErrAppReviewNotFound = status.Error(codes.NotFound, "app review not found") ErrAppReviewDeleted = status.Error(codes.NotFound, "app review was deleted") ErrNotAllowedToModifyAppReview = status.Errorf( codes.PermissionDenied, "you are not allowed to modify this app review", ) ErrWebhookURLNotSpecified = status.Errorf( codes.InvalidArgument, "WebhookURL not specified", ) ErrAppTokenNotFound = status.Error(codes.NotFound, "app token not found") ErrUserNotAllowedToManageAppTokens = status.Errorf( codes.PermissionDenied, "user not allowed to manage app tokens", ) ErrAppRoleNotSet = status.Error(codes.FailedPrecondition, "app role not set") )
Functions ¶
func ErrInvalidParam ¶
func ErrRequiredParam ¶
func ErrUnsupported ¶
func HandlePayload ¶
Types ¶
type Service ¶
func New ¶
func New( ctx context.Context, repo repo.Repository, eventBus Publisher, circleClient circle.CircleAPIClient, authClient authV1.AuthAPIClient, roleClient role.RoleAPIClient, httpClient *http.Client, appScopedTokenLifespan time.Duration, userScopedTokenLifespan time.Duration, ) (*Service, error)
func (*Service) AddAppPermission ¶
func (*Service) AddAppScore ¶
func (*Service) AddAppSubscription ¶
func (*Service) CreateAppReview ¶
func (*Service) DeleteAppReview ¶
func (*Service) DeleteAppToken ¶
func (*Service) DisableAppByDefault ¶
func (*Service) DisableAppInCircle ¶
func (*Service) DownvoteAppReview ¶
func (*Service) EnableAppByDefault ¶
func (*Service) EnableAppInCircle ¶
func (*Service) EnableAppInCircles ¶
func (*Service) EnableAppsInCircle ¶
func (*Service) GenerateAppToken ¶
func (*Service) GenerateUserScopedAppToken ¶
func (*Service) GetAppCounters ¶
func (*Service) GetAppLastUsedAt ¶
func (*Service) GetAppPermissions ¶
func (*Service) GetAppReview ¶
func (*Service) GetAppReviews ¶
func (*Service) GetAppReviewsByUser ¶
func (*Service) GetAppSavedAt ¶
func (*Service) GetAppSubscriptions ¶
func (*Service) GetAppTags ¶
func (*Service) GetAppTokens ¶
func (*Service) GetAppUpvotedAt ¶
func (*Service) GetAppsEnabledByDefault ¶
func (*Service) GetCircleApps ¶
func (*Service) GetDefaultPermissions ¶
func (s *Service) GetDefaultPermissions() []model.Permission
func (*Service) GetEnabledApps ¶
func (*Service) GetFeaturedApps ¶
func (*Service) GetLastUsedApps ¶
func (*Service) GetPermissions ¶
func (*Service) GetSavedApps ¶
func (*Service) GetSubscriptions ¶
func (*Service) GrantAppPermissionsInCircle ¶
func (*Service) GrantAppSubscriptionsInCircle ¶
func (*Service) HandleAppEvent ¶
func (*Service) HandleAppPermissionAdded ¶
func (*Service) HandleAppSubscription ¶
func (*Service) HandleAppSubscriptionAdded ¶
func (*Service) HandleChatEvent ¶
func (*Service) HandleCircleCommentCreated ¶
func (*Service) HandleCircleCreated ¶
func (*Service) HandleCircleDeleted ¶
func (*Service) HandleCircleEvent ¶
func (*Service) HandleCircleMessageSent ¶
func (*Service) HandleCirclePostCreated ¶
func (*Service) HandleCommentEvent ¶
func (*Service) HandleContentEvent ¶
func (*Service) HandleDefaultAppCreated ¶
func (*Service) HandleUserJoinedCircle ¶
func (*Service) HandleUserLeftCircle ¶
func (*Service) IssueAppToken ¶
func (*Service) RemoveAppPermission ¶
func (*Service) RemoveAppSubscription ¶
func (*Service) RemoveAppTag ¶
func (*Service) RevokeAppPermissionsInCircle ¶
func (*Service) RevokeAppSubscriptionsInCircle ¶
func (*Service) RevokeAppToken ¶
func (*Service) SearchApps ¶
func (*Service) UndownvoteAppReview ¶
func (*Service) UnfeatureApp ¶
func (*Service) UnupvoteApp ¶
func (*Service) UnupvoteAppReview ¶
func (*Service) UpvoteAppReview ¶
func (*Service) ValidateAppCreateInput ¶
func (*Service) ValidateAppDescription ¶
func (*Service) ValidateAppImageURL ¶
func (*Service) ValidateAppName ¶
func (*Service) ValidateAppReviewRating ¶
func (*Service) ValidateAppURL ¶
func (*Service) ValidateAppWebhookURL ¶
func (*Service) ValidateCreateAppReviewInput ¶
func (*Service) ValidatePermissionID ¶
func (*Service) ValidateSubscriptionID ¶
func (*Service) ValidateUpdateInput ¶
Source Files ¶
- add_app_permission.go
- add_app_score.go
- add_app_subscription.go
- add_app_tag.go
- app_subscription_event.go
- circle_deleted_event.go
- create_app.go
- create_app_review.go
- delete_app.go
- delete_app_review.go
- delete_app_token.go
- disable_app_by_default.go
- disable_app_in_circle.go
- downvote_app_review.go
- enable_app_by_default.go
- enable_app_in_circle.go
- errors.go
- event_handlers.go
- feature_app.go
- generate_app_token.go
- generate_user_scoped_app_token.go
- get_app.go
- get_app_counters.go
- get_app_last_used_at.go
- get_app_permissions.go
- get_app_review.go
- get_app_reviews.go
- get_app_reviews_by_user.go
- get_app_saved_at.go
- get_app_subscriptions.go
- get_app_tags.go
- get_app_tokens.go
- get_app_upvoted_at.go
- get_apps.go
- get_apps_enabled_by_default.go
- get_circles_by_enabled_app.go
- get_default_permissions.go
- get_enabled_apps.go
- get_featured_apps.go
- get_last_used_apps.go
- get_my_apps.go
- get_permissions.go
- get_saved_apps.go
- get_subscriptions.go
- get_tags.go
- grant_app_permissions_in_circle.go
- grant_app_subscriptions_in_circle.go
- issue_app_token.go
- new_app_event.go
- new_app_permission_event.go
- new_app_subscription_event.go
- new_circle_comment_event.go
- new_circle_event.go
- new_circle_message_event.go
- new_circle_post_event.go
- remove_app_permission.go
- remove_app_subscription.go
- remove_app_tag.go
- revoke_app_permissions_in_circle.go
- revoke_app_subscriptions_in_circle.go
- revoke_app_token.go
- save_app.go
- search_apps.go
- service.go
- undownvote_app_review.go
- unfeature_app.go
- unsave_app.go
- unupvote_app.go
- unupvote_app_review.go
- update_app.go
- upvote_app.go
- upvote_app_review.go
- user_joined_circle_event.go
- user_left_circle_event.go
Click to show internal directories.
Click to hide internal directories.