Documentation
¶
Overview ¶
Package relationships provides error handling utilities for relationship operations.
Package relationships provides the core Relationships Service for the Lesser project's API alignment. This service handles all relationship operations including follows, blocks, mutes, and relationship status management. It emits appropriate events for real-time streaming and queues federation activities for remote users.
Index ¶
- Variables
- func CannotAcceptOwnFollowRequest() *pkgerrors.AppError
- func CannotBlockSelf() *pkgerrors.AppError
- func CannotFollowSelf() *pkgerrors.AppError
- func CannotMuteSelf() *pkgerrors.AppError
- func CannotRejectOwnFollowRequest() *pkgerrors.AppError
- func CheckFollowingRelationship(err error) *pkgerrors.AppError
- func DomainBlockRepositoryNotAvailable() *pkgerrors.AppError
- func FailedToAcceptFollowRequest(err error) *pkgerrors.AppError
- func FailedToAddDomainBlock(err error) *pkgerrors.AppError
- func FailedToBlockUser(err error) *pkgerrors.AppError
- func FailedToBuildRelationshipData(err error) *pkgerrors.AppError
- func FailedToCheckBlockStatus(err error) *pkgerrors.AppError
- func FailedToCheckFollowStatus(err error) *pkgerrors.AppError
- func FailedToCheckMuteStatus(err error) *pkgerrors.AppError
- func FailedToCountFollowers(err error) *pkgerrors.AppError
- func FailedToCountFollowing(err error) *pkgerrors.AppError
- func FailedToCreateFollowRequest(err error) *pkgerrors.AppError
- func FailedToGetAccount(err error) *pkgerrors.AppError
- func FailedToGetActor(err error) *pkgerrors.AppError
- func FailedToGetBlockedUsers(err error) *pkgerrors.AppError
- func FailedToGetDomainBlocks(err error) *pkgerrors.AppError
- func FailedToGetExistingRelationship(err error) *pkgerrors.AppError
- func FailedToGetMutedUsers(err error) *pkgerrors.AppError
- func FailedToGetPendingFollowRequests(err error) *pkgerrors.AppError
- func FailedToGetRelationshipUsers(err error) *pkgerrors.AppError
- func FailedToGetUpdatedRelationship(err error) *pkgerrors.AppError
- func FailedToMuteUser(err error) *pkgerrors.AppError
- func FailedToRejectFollowRequest(err error) *pkgerrors.AppError
- func FailedToRemoveDomainBlock(err error) *pkgerrors.AppError
- func FailedToUnblockUser(err error) *pkgerrors.AppError
- func FailedToUnfollow(err error) *pkgerrors.AppError
- func FailedToUnmuteUser(err error) *pkgerrors.AppError
- func NoRepositoryOrStorage() *pkgerrors.AppError
- func RepositoryNotAvailable(repoType string) *pkgerrors.AppError
- func SocialRepositoryNotAvailable() *pkgerrors.AppError
- func StorageNotAvailable() *pkgerrors.AppError
- func TargetIDsEmpty() *pkgerrors.AppError
- func TooManyTargetIDs(count int) *pkgerrors.AppError
- func ValidationFailed() *pkgerrors.AppError
- type AcceptFollowRequestCommand
- type AcknowledgeSeveranceCommand
- type AcknowledgeSeveranceResult
- type AddDomainBlockCommand
- type AffectedRelationship
- type BlockCommand
- type BlockedUsersResult
- type DomainBlocksResult
- type FederationService
- type FollowCommand
- type FollowRequestsResult
- type FollowResult
- type FollowersResult
- type GetAffectedRelationshipsQuery
- type GetAffectedRelationshipsResult
- type GetBlockedUsersQuery
- type GetDomainBlocksQuery
- type GetFollowRequestsQuery
- type GetFollowersQuery
- type GetMutedUsersQuery
- type GetRelationshipQuery
- type GetRelationshipsQuery
- type MuteCommand
- type MutedUsersResult
- type RejectFollowRequestCommand
- type RelationshipData
- type RelationshipResult
- type RemoveDomainBlockCommand
- type Result
- type Service
- func (s *Service) AcceptFollowRequest(ctx context.Context, cmd *AcceptFollowRequestCommand) (*RelationshipResult, error)
- func (s *Service) AcknowledgeSeverance(ctx context.Context, cmd *AcknowledgeSeveranceCommand) (*AcknowledgeSeveranceResult, error)
- func (s *Service) AddDomainBlock(ctx context.Context, cmd *AddDomainBlockCommand) error
- func (s *Service) Block(ctx context.Context, cmd *BlockCommand) (*RelationshipResult, error)
- func (s *Service) CountFollowers(ctx context.Context, username string) (int64, error)
- func (s *Service) CountFollowing(ctx context.Context, username string) (int64, error)
- func (s *Service) Follow(ctx context.Context, cmd *FollowCommand) (*FollowResult, error)
- func (s *Service) GetAffectedRelationships(_ context.Context, query *GetAffectedRelationshipsQuery) (*GetAffectedRelationshipsResult, error)
- func (s *Service) GetBlockedUsers(ctx context.Context, query *GetBlockedUsersQuery) (*BlockedUsersResult, error)
- func (s *Service) GetDomainBlocks(ctx context.Context, query *GetDomainBlocksQuery) (*DomainBlocksResult, error)
- func (s *Service) GetFollowers(ctx context.Context, username string, limit int, cursor string) ([]*storage.Account, string, error)
- func (s *Service) GetFollowing(ctx context.Context, username string, limit int, cursor string) ([]*storage.Account, string, error)
- func (s *Service) GetMutedUsers(ctx context.Context, query *GetMutedUsersQuery) (*MutedUsersResult, error)
- func (s *Service) GetPendingFollowRequests(ctx context.Context, query *GetFollowRequestsQuery) (*FollowRequestsResult, error)
- func (s *Service) GetRelationship(ctx context.Context, requesterID, targetID string) (*RelationshipData, error)
- func (s *Service) GetRelationships(ctx context.Context, query *GetRelationshipsQuery) (*Result, error)
- func (s *Service) IsBlocked(ctx context.Context, blockerID, blockedID string) (bool, error)
- func (s *Service) IsMuted(ctx context.Context, muterID, mutedID string) (bool, error)
- func (s *Service) Mute(ctx context.Context, cmd *MuteCommand) (*RelationshipResult, error)
- func (s *Service) RejectFollowRequest(ctx context.Context, cmd *RejectFollowRequestCommand) (*RelationshipResult, error)
- func (s *Service) RemoveDomainBlock(ctx context.Context, cmd *RemoveDomainBlockCommand) error
- func (s *Service) Unblock(ctx context.Context, cmd *UnblockCommand) (*RelationshipResult, error)
- func (s *Service) Unfollow(ctx context.Context, cmd *UnfollowCommand) (*RelationshipResult, error)
- func (s *Service) Unmute(ctx context.Context, cmd *UnmuteCommand) (*RelationshipResult, error)
- func (s *Service) UpdateRelationship(ctx context.Context, cmd *UpdateRelationshipCommand) (*RelationshipData, error)
- type UnblockCommand
- type UnfollowCommand
- type UnmuteCommand
- type UpdateRelationshipCommand
Constants ¶
This section is empty.
Variables ¶
var ErrFollowRequestNotFound = pkgerrors.NewAppError(pkgerrors.CodeNotFound, pkgerrors.CategoryBusiness, "follow request not found")
ErrFollowRequestNotFound is specific to relationships - keep as local error
var ErrFollowWhileBlocked = pkgerrors.BusinessRuleViolated("follow_while_blocked", map[string]interface{}{"reason": "user is blocked"})
ErrFollowWhileBlocked is a unique business rule - keep as local error
var ErrUnsupportedRelationType = pkgerrors.NewValidationError("relation_type", "unsupported")
ErrUnsupportedRelationType is specific to relationships - keep as local error
Functions ¶
func CannotAcceptOwnFollowRequest ¶
CannotAcceptOwnFollowRequest returns an error when trying to accept one's own follow request.
func CannotBlockSelf ¶
CannotBlockSelf returns an error when trying to block oneself.
func CannotFollowSelf ¶
CannotFollowSelf returns an error when trying to follow oneself.
func CannotMuteSelf ¶
CannotMuteSelf returns an error when trying to mute oneself.
func CannotRejectOwnFollowRequest ¶
CannotRejectOwnFollowRequest returns an error when trying to reject one's own follow request.
func CheckFollowingRelationship ¶
CheckFollowingRelationship returns an error when failing to check following relationship.
func DomainBlockRepositoryNotAvailable ¶
DomainBlockRepositoryNotAvailable returns an error when domain block repository is not available.
func FailedToAcceptFollowRequest ¶
FailedToAcceptFollowRequest returns an error when failing to accept follow request.
func FailedToAddDomainBlock ¶
FailedToAddDomainBlock returns an error when failing to add domain block.
func FailedToBlockUser ¶
FailedToBlockUser returns an error when failing to block user.
func FailedToBuildRelationshipData ¶
FailedToBuildRelationshipData returns an error when failing to build relationship data.
func FailedToCheckBlockStatus ¶
FailedToCheckBlockStatus returns an error when failing to check block status.
func FailedToCheckFollowStatus ¶
FailedToCheckFollowStatus returns an error when failing to check follow status.
func FailedToCheckMuteStatus ¶
FailedToCheckMuteStatus returns an error when failing to check mute status.
func FailedToCountFollowers ¶
FailedToCountFollowers returns an error when failing to count followers.
func FailedToCountFollowing ¶
FailedToCountFollowing returns an error when failing to count following.
func FailedToCreateFollowRequest ¶
FailedToCreateFollowRequest returns an error when failing to create follow request.
func FailedToGetAccount ¶
FailedToGetAccount returns an error when failing to get account.
func FailedToGetActor ¶
FailedToGetActor returns an error when failing to get actor.
func FailedToGetBlockedUsers ¶
FailedToGetBlockedUsers returns an error when failing to get blocked users.
func FailedToGetDomainBlocks ¶
FailedToGetDomainBlocks returns an error when failing to get domain blocks.
func FailedToGetExistingRelationship ¶
FailedToGetExistingRelationship returns an error when failing to get existing relationship.
func FailedToGetMutedUsers ¶
FailedToGetMutedUsers returns an error when failing to get muted users.
func FailedToGetPendingFollowRequests ¶
FailedToGetPendingFollowRequests returns an error when failing to get pending follow requests.
func FailedToGetRelationshipUsers ¶
FailedToGetRelationshipUsers returns an error when failing to get relationship users.
func FailedToGetUpdatedRelationship ¶
FailedToGetUpdatedRelationship returns an error when failing to get updated relationship.
func FailedToMuteUser ¶
FailedToMuteUser returns an error when failing to mute user.
func FailedToRejectFollowRequest ¶
FailedToRejectFollowRequest returns an error when failing to reject follow request.
func FailedToRemoveDomainBlock ¶
FailedToRemoveDomainBlock returns an error when failing to remove domain block.
func FailedToUnblockUser ¶
FailedToUnblockUser returns an error when failing to unblock user.
func FailedToUnfollow ¶
FailedToUnfollow returns an error when failing to unfollow.
func FailedToUnmuteUser ¶
FailedToUnmuteUser returns an error when failing to unmute user.
func NoRepositoryOrStorage ¶
NoRepositoryOrStorage returns an error when neither repository nor storage is available.
func RepositoryNotAvailable ¶
RepositoryNotAvailable returns an error when a repository is not available.
func SocialRepositoryNotAvailable ¶
SocialRepositoryNotAvailable returns an error when social repository is not available.
func StorageNotAvailable ¶
StorageNotAvailable returns an error when storage is not available.
func TargetIDsEmpty ¶
TargetIDsEmpty returns an error when target IDs are empty.
func TooManyTargetIDs ¶
TooManyTargetIDs returns an error when too many target IDs are provided.
func ValidationFailed ¶
ValidationFailed returns an error when validation fails.
Types ¶
type AcceptFollowRequestCommand ¶
type AcceptFollowRequestCommand struct {
RequesterID string `json:"requester_id" validate:"required"` // User accepting the request
FollowerID string `json:"follower_id" validate:"required"` // User who sent the request
}
AcceptFollowRequestCommand contains data needed to accept a follow request
type AcknowledgeSeveranceCommand ¶
type AcknowledgeSeveranceCommand struct {
UserID string `json:"user_id" validate:"required"`
SeveranceID string `json:"severance_id" validate:"required"`
}
AcknowledgeSeveranceCommand contains data needed to acknowledge a severance
type AcknowledgeSeveranceResult ¶
type AcknowledgeSeveranceResult struct {
Success bool `json:"success"`
Events []*streaming.Event `json:"events"`
}
AcknowledgeSeveranceResult contains the result of acknowledging a severance
type AddDomainBlockCommand ¶
type AddDomainBlockCommand struct {
UserID string `json:"user_id" validate:"required"`
Domain string `json:"domain" validate:"required"`
}
AddDomainBlockCommand contains data needed to add a domain block
type AffectedRelationship ¶
type AffectedRelationship struct {
ID string `json:"id"`
Type string `json:"type"`
AffectedUser storage.User `json:"affected_user"`
}
AffectedRelationship represents a relationship affected by severance
type BlockCommand ¶
type BlockCommand struct {
BlockerID string `json:"blocker_id" validate:"required"`
BlockedID string `json:"blocked_id" validate:"required"`
Reason string `json:"reason"` // Optional reason for blocking
}
BlockCommand contains all data needed to block a user
type BlockedUsersResult ¶
type BlockedUsersResult struct {
BlockedUsers []*storage.Account `json:"blocked_users"`
NextCursor string `json:"next_cursor,omitempty"`
Events []*streaming.Event `json:"events"`
}
BlockedUsersResult contains blocked users data
type DomainBlocksResult ¶
type DomainBlocksResult struct {
Domains []string `json:"domains"`
NextCursor string `json:"next_cursor,omitempty"`
Events []*streaming.Event `json:"events"`
}
DomainBlocksResult contains domain blocks data
type FederationService ¶
type FederationService interface {
QueueActivity(ctx context.Context, activity *activitypub.Activity) error
}
FederationService defines the interface for federation operations
type FollowCommand ¶
type FollowCommand struct {
FollowerID string `json:"follower_id" validate:"required"`
FollowingID string `json:"following_id" validate:"required"`
ShowReblogs bool `json:"show_reblogs"` // Whether to show reblogs from this user
Notify bool `json:"notify"` // Whether to notify on new posts
Languages []string `json:"languages"` // Filter to specific languages
}
FollowCommand contains all data needed to follow a user
type FollowRequestsResult ¶
type FollowRequestsResult struct {
FollowerIDs []string `json:"follower_ids"`
NextCursor string `json:"next_cursor,omitempty"`
Events []*streaming.Event `json:"events"`
}
FollowRequestsResult contains follow requests data
type FollowResult ¶
type FollowResult struct {
Relationship *RelationshipData `json:"relationship"`
RequestID string `json:"request_id,omitempty"` // If follow requires approval
IsFollowing bool `json:"is_following"` // Whether follow was immediately accepted
Events []*streaming.Event `json:"events"`
Activity *activitypub.Activity `json:"activity,omitempty"`
}
FollowResult contains follow-specific data and events
type FollowersResult ¶
type FollowersResult struct {
Followers []*storage.Account `json:"followers"`
NextCursor string `json:"next_cursor,omitempty"`
Events []*streaming.Event `json:"events"`
}
FollowersResult contains followers data
type GetAffectedRelationshipsQuery ¶
type GetAffectedRelationshipsQuery struct {
UserID string `json:"user_id" validate:"required"`
SeveredRelationshipID string `json:"severed_relationship_id" validate:"required"`
}
GetAffectedRelationshipsQuery contains data needed to get affected relationships
type GetAffectedRelationshipsResult ¶
type GetAffectedRelationshipsResult struct {
Relationships []*AffectedRelationship `json:"relationships"`
HasNextPage bool `json:"has_next_page"`
HasPreviousPage bool `json:"has_previous_page"`
Events []*streaming.Event `json:"events"`
}
GetAffectedRelationshipsResult contains the result of getting affected relationships
type GetBlockedUsersQuery ¶
type GetBlockedUsersQuery struct {
UserID string `json:"user_id" validate:"required"`
Limit int `json:"limit"`
Cursor string `json:"cursor"`
}
GetBlockedUsersQuery contains parameters for retrieving blocked users
type GetDomainBlocksQuery ¶
type GetDomainBlocksQuery struct {
UserID string `json:"user_id" validate:"required"`
Limit int `json:"limit"`
Cursor string `json:"cursor"`
}
GetDomainBlocksQuery contains parameters for retrieving domain blocks
type GetFollowRequestsQuery ¶
type GetFollowRequestsQuery struct {
UserID string `json:"user_id" validate:"required"`
Limit int `json:"limit"`
Cursor string `json:"cursor"`
}
GetFollowRequestsQuery contains parameters for retrieving pending follow requests
type GetFollowersQuery ¶
type GetFollowersQuery struct {
UserID string `json:"user_id" validate:"required"`
Limit int `json:"limit"`
Cursor string `json:"cursor"`
}
GetFollowersQuery contains parameters for retrieving followers
type GetMutedUsersQuery ¶
type GetMutedUsersQuery struct {
UserID string `json:"user_id" validate:"required"`
Limit int `json:"limit"`
Cursor string `json:"cursor"`
}
GetMutedUsersQuery contains parameters for retrieving muted users
type GetRelationshipQuery ¶
type GetRelationshipQuery struct {
RequesterID string `json:"requester_id" validate:"required"`
TargetID string `json:"target_id" validate:"required"`
}
GetRelationshipQuery contains parameters for retrieving relationship status
type GetRelationshipsQuery ¶
type GetRelationshipsQuery struct {
RequesterID string `json:"requester_id" validate:"required"`
TargetIDs []string `json:"target_ids" validate:"required,max=40"`
}
GetRelationshipsQuery contains parameters for retrieving multiple relationship statuses
type MuteCommand ¶
type MuteCommand struct {
MuterID string `json:"muter_id" validate:"required"`
MutedID string `json:"muted_id" validate:"required"`
MuteNotifications bool `json:"mute_notifications"` // Also mute notifications
Duration *time.Duration `json:"duration"` // Optional duration, nil for indefinite
Reason string `json:"reason"` // Optional reason for muting
}
MuteCommand contains all data needed to mute a user
type MutedUsersResult ¶
type MutedUsersResult struct {
MutedUsers []*storage.Account `json:"muted_users"`
NextCursor string `json:"next_cursor,omitempty"`
Events []*streaming.Event `json:"events"`
}
MutedUsersResult contains muted users data
type RejectFollowRequestCommand ¶
type RejectFollowRequestCommand struct {
RequesterID string `json:"requester_id" validate:"required"` // User rejecting the request
FollowerID string `json:"follower_id" validate:"required"` // User who sent the request
}
RejectFollowRequestCommand contains data needed to reject a follow request
type RelationshipData ¶
type RelationshipData struct {
ID string `json:"id"`
Following bool `json:"following"`
ShowingReblogs bool `json:"showing_reblogs"`
Notifying bool `json:"notifying"`
Languages []string `json:"languages"`
FollowedBy bool `json:"followed_by"`
Blocking bool `json:"blocking"`
BlockedBy bool `json:"blocked_by"`
Muting bool `json:"muting"`
MutingNotifications bool `json:"muting_notifications"`
Requested bool `json:"requested"`
RequestedBy bool `json:"requested_by"`
DomainBlocking bool `json:"domain_blocking"`
Endorsed bool `json:"endorsed"`
Note string `json:"note"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
RelationshipData contains comprehensive relationship information
type RelationshipResult ¶
type RelationshipResult struct {
Relationship *RelationshipData `json:"relationship"`
Events []*streaming.Event `json:"events"`
}
RelationshipResult contains a relationship and associated events that were emitted
type RemoveDomainBlockCommand ¶
type RemoveDomainBlockCommand struct {
UserID string `json:"user_id" validate:"required"`
Domain string `json:"domain" validate:"required"`
}
RemoveDomainBlockCommand contains data needed to remove a domain block
type Result ¶
type Result struct {
Relationships []*RelationshipData `json:"relationships"`
Events []*streaming.Event `json:"events"`
}
Result contains multiple relationships
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides relationship operations
func NewService ¶
func NewService( relationshipRepo interfaces.RelationshipRepository, accountRepo interfaces.AccountRepository, publisher streaming.Publisher, federation FederationService, logger *zap.Logger, domainName string, ) *Service
NewService creates a new Relationships Service with the required dependencies
func NewServiceWithStorage ¶
func NewServiceWithStorage( storage core.RepositoryStorage, publisher streaming.Publisher, federation FederationService, logger *zap.Logger, domainName string, ) *Service
NewServiceWithStorage creates a new Relationships Service with full storage access
func (*Service) AcceptFollowRequest ¶
func (s *Service) AcceptFollowRequest(ctx context.Context, cmd *AcceptFollowRequestCommand) (*RelationshipResult, error)
AcceptFollowRequest accepts a pending follow request
func (*Service) AcknowledgeSeverance ¶
func (s *Service) AcknowledgeSeverance(ctx context.Context, cmd *AcknowledgeSeveranceCommand) (*AcknowledgeSeveranceResult, error)
AcknowledgeSeverance acknowledges a relationship severance
func (*Service) AddDomainBlock ¶
func (s *Service) AddDomainBlock(ctx context.Context, cmd *AddDomainBlockCommand) error
AddDomainBlock adds a domain block for a user
func (*Service) Block ¶
func (s *Service) Block(ctx context.Context, cmd *BlockCommand) (*RelationshipResult, error)
Block blocks a user, automatically unfollows, and emits events
func (*Service) CountFollowers ¶
CountFollowers counts the number of followers for a user
func (*Service) CountFollowing ¶
CountFollowing counts the number of users that an actor is following
func (*Service) Follow ¶
func (s *Service) Follow(ctx context.Context, cmd *FollowCommand) (*FollowResult, error)
Follow initiates a follow relationship, handling locked accounts and emitting events
func (*Service) GetAffectedRelationships ¶
func (s *Service) GetAffectedRelationships(_ context.Context, query *GetAffectedRelationshipsQuery) (*GetAffectedRelationshipsResult, error)
GetAffectedRelationships retrieves relationships affected by a severance
func (*Service) GetBlockedUsers ¶
func (s *Service) GetBlockedUsers(ctx context.Context, query *GetBlockedUsersQuery) (*BlockedUsersResult, error)
GetBlockedUsers retrieves blocked users for a user
func (*Service) GetDomainBlocks ¶
func (s *Service) GetDomainBlocks(ctx context.Context, query *GetDomainBlocksQuery) (*DomainBlocksResult, error)
GetDomainBlocks retrieves domain blocks for a user
func (*Service) GetFollowers ¶
func (s *Service) GetFollowers(ctx context.Context, username string, limit int, cursor string) ([]*storage.Account, string, error)
GetFollowers retrieves followers for a user
func (*Service) GetFollowing ¶
func (s *Service) GetFollowing(ctx context.Context, username string, limit int, cursor string) ([]*storage.Account, string, error)
GetFollowing retrieves users being followed by a user
func (*Service) GetMutedUsers ¶
func (s *Service) GetMutedUsers(ctx context.Context, query *GetMutedUsersQuery) (*MutedUsersResult, error)
GetMutedUsers retrieves muted users for a user
func (*Service) GetPendingFollowRequests ¶
func (s *Service) GetPendingFollowRequests(ctx context.Context, query *GetFollowRequestsQuery) (*FollowRequestsResult, error)
GetPendingFollowRequests retrieves pending follow requests for a user
func (*Service) GetRelationship ¶
func (s *Service) GetRelationship(ctx context.Context, requesterID, targetID string) (*RelationshipData, error)
GetRelationship retrieves relationship status between two users
func (*Service) GetRelationships ¶
func (s *Service) GetRelationships(ctx context.Context, query *GetRelationshipsQuery) (*Result, error)
GetRelationships retrieves relationship statuses for multiple users
func (*Service) Mute ¶
func (s *Service) Mute(ctx context.Context, cmd *MuteCommand) (*RelationshipResult, error)
Mute mutes a user (hides from timelines) and emits events
func (*Service) RejectFollowRequest ¶
func (s *Service) RejectFollowRequest(ctx context.Context, cmd *RejectFollowRequestCommand) (*RelationshipResult, error)
RejectFollowRequest rejects a pending follow request
func (*Service) RemoveDomainBlock ¶
func (s *Service) RemoveDomainBlock(ctx context.Context, cmd *RemoveDomainBlockCommand) error
RemoveDomainBlock removes a domain block for a user
func (*Service) Unblock ¶
func (s *Service) Unblock(ctx context.Context, cmd *UnblockCommand) (*RelationshipResult, error)
Unblock removes a user block and emits events
func (*Service) Unfollow ¶
func (s *Service) Unfollow(ctx context.Context, cmd *UnfollowCommand) (*RelationshipResult, error)
Unfollow removes a follow relationship and emits events
func (*Service) Unmute ¶
func (s *Service) Unmute(ctx context.Context, cmd *UnmuteCommand) (*RelationshipResult, error)
Unmute removes a user mute and emits events
func (*Service) UpdateRelationship ¶
func (s *Service) UpdateRelationship(ctx context.Context, cmd *UpdateRelationshipCommand) (*RelationshipData, error)
UpdateRelationship updates preferences for an existing relationship
type UnblockCommand ¶
type UnblockCommand struct {
BlockerID string `json:"blocker_id" validate:"required"`
BlockedID string `json:"blocked_id" validate:"required"`
}
UnblockCommand contains all data needed to unblock a user
type UnfollowCommand ¶
type UnfollowCommand struct {
FollowerID string `json:"follower_id" validate:"required"`
FollowingID string `json:"following_id" validate:"required"`
}
UnfollowCommand contains all data needed to unfollow a user
type UnmuteCommand ¶
type UnmuteCommand struct {
MuterID string `json:"muter_id" validate:"required"`
MutedID string `json:"muted_id" validate:"required"`
}
UnmuteCommand contains all data needed to unmute a user
type UpdateRelationshipCommand ¶
type UpdateRelationshipCommand struct {
FollowerID string `json:"follower_id" validate:"required"`
FollowingID string `json:"following_id" validate:"required"`
Notify *bool `json:"notify,omitempty"` // Update notification settings
ShowReblogs *bool `json:"show_reblogs,omitempty"` // Update reblog visibility
Languages *[]string `json:"languages,omitempty"` // Update language filter
Note *string `json:"note,omitempty"` // Update private note
}
UpdateRelationshipCommand contains data for updating relationship preferences