Documentation ¶
Index ¶
- Variables
- func CanSeeProfile(profile *core.User, visitor *core.User, connRadius ConnectionRadius) bool
- func CannotSeeProfileLite(profile *core.User, visitor *core.User) bool
- func CreateConnection(ctx context.Context, db boil.ContextExecutor, user1ID string, user2ID string) (*core.UserConnection, *core.UserConnection, error)
- func DecideConnectionRequest(ctx context.Context, exec *sqlx.DB, targetUserID string, requestID string, ...) error
- func DecideForwardMediationRequest(ctx context.Context, exec *sqlx.DB, whoUserID string, requestID string, ...) error
- func DropConnection(ctx context.Context, exec *sqlx.DB, sourceUserID string, targetUserID string) error
- func DropConnectionGrant(ctx context.Context, exec boil.ContextExecutor, whoUserID string, ...) error
- func EstablishConnection(ctx context.Context, exec *sqlx.DB, sourceUserID string, targetUserID string) error
- func GetDirectAndSecondDegreeUserIDs(ctx context.Context, db boil.ContextExecutor, userID string) (directUserIDs []string, secondDegreeUserIDs []string, via map[string][]string, ...)
- func GetDirectUserIDs(ctx context.Context, db boil.ContextExecutor, userID string) ([]string, error)
- func GetMediationRequest(ctx context.Context, exec boil.ContextExecutor, sourceUserID string, ...) (*core.UserConnectionMediationRequest, error)
- func IsConnectionAllowed(ctx context.Context, exec boil.ContextExecutor, sourceUserID string, ...) (bool, error)
- func RequestMediation(ctx context.Context, exec *sqlx.DB, sourceUserID string, targetUserID string, ...) error
- func RevokeMediationRequest(ctx context.Context, exec *sqlx.DB, whoUserID string, targetUserID string) error
- type ConnectionRadius
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoConnectionRequest = errors.Errorf("No such connection request")
View Source
var ErrUserNotSignedIn = errors.Errorf("One of the users is not signed in")
Functions ¶
func CanSeeProfile ¶
func CreateConnection ¶
func CreateConnection(ctx context.Context, db boil.ContextExecutor, user1ID string, user2ID string) (*core.UserConnection, *core.UserConnection, error)
CreateConnection assumes it's run in transaction Since connections form an undirected graph, we insert user ids in both combinations to simplify queries with a tradeoff that we need to monitor data for consistency and use twice the size needed
func DecideConnectionRequest ¶
func DropConnection ¶
func DropConnectionGrant ¶
func EstablishConnection ¶
func GetDirectUserIDs ¶
func GetMediationRequest ¶
func GetMediationRequest(ctx context.Context, exec boil.ContextExecutor, sourceUserID string, targetUserID string) (*core.UserConnectionMediationRequest, error)
func IsConnectionAllowed ¶
func IsConnectionAllowed(ctx context.Context, exec boil.ContextExecutor, sourceUserID string, targetUserID string) (bool, error)
IsConnectionAllowed is used to determine whether sourceUserID is allowed to connect with targetUserID
func RequestMediation ¶
Types ¶
type ConnectionRadius ¶
type ConnectionRadius int
const ( ConnectionRadiusSameUser ConnectionRadius = iota ConnectionRadiusDirect ConnectionRadiusSecondDegree ConnectionRadiusUnknown )
func GetConnectionRadius ¶
func GetConnectionRadius(ctx context.Context, db boil.ContextExecutor, fromUserID string, toUserID string) (ConnectionRadius, error)
func (ConnectionRadius) IsDirect ¶
func (cr ConnectionRadius) IsDirect() bool
func (ConnectionRadius) IsSameUser ¶
func (cr ConnectionRadius) IsSameUser() bool
func (ConnectionRadius) IsSecondDegree ¶
func (cr ConnectionRadius) IsSecondDegree() bool
func (ConnectionRadius) IsUnrelated ¶
func (cr ConnectionRadius) IsUnrelated() bool
Click to show internal directories.
Click to hide internal directories.