Documentation
¶
Index ¶
- type Handler
- func (h *Handler) Create(c *echo.Context) error
- func (h *Handler) Delete(c *echo.Context) error
- func (h *Handler) List(c *echo.Context) error
- func (h *Handler) Pull(c *echo.Context) error
- func (h *Handler) Push(c *echo.Context) error
- func (h *Handler) SetBlockingRepo(r repository.BlockingRepository)
- func (h *Handler) SetFavoriteRepo(r UserListFavoriteReader)
- func (h *Handler) SetProxyFollow(p ProxyFollowEnqueuer)
- func (h *Handler) SetUserListEventPublisher(p UserListEventPublisher)
- func (h *Handler) SetUserRepo(r repository.UserRepository)
- func (h *Handler) Show(c *echo.Context) error
- type ProxyFollowEnqueuer
- type UserListEventPublisher
- type UserListFavoriteReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles users/lists API endpoints.
func NewHandler ¶
func NewHandler(repo repository.UserListRepository, idGen id.Generator, entityPacker *entity.Packer, rolePolicyProvider role.PolicyProvider) *Handler
NewHandler creates a new userlists Handler. entityPacker is the Packer this Handler packs entities with (#3794); rolePolicyProvider enforces the userListLimit / userEachUserListsLimit role policies (#1029).
func (*Handler) Create ¶
Create handles POST /api/users/lists/create.
新規作成時は member 0 件なので userIds は []。upstream と同じ packed shape を返す (#871)。
func (*Handler) List ¶
List handles POST /api/users/lists/list.
upstream list.ts は requireCredential:false で、userId(optional) 指定時は対象 ユーザーの public list を返す (host!=null は REMOTE_USER_NOT_ALLOWED、不在は NO_SUCH_USER)。userId 未指定 && 未認証は INVALID_PARAM (#1550)。packed shape ({id, createdAt, name, userIds, isPublic})、userIds は ListMembersByListIDs で batch fetch (#876)。
func (*Handler) SetBlockingRepo ¶
func (h *Handler) SetBlockingRepo(r repository.BlockingRepository)
SetBlockingRepo wires a BlockingRepository so Push can reject adding a user who has blocked the caller (YOU_HAVE_BEEN_BLOCKED), matching upstream users/lists/push blocking check (#1550). Fail-closed: a repo error is treated as "blocked" to avoid leaking the membership against the blocker's intent.
func (*Handler) SetFavoriteRepo ¶
func (h *Handler) SetFavoriteRepo(r UserListFavoriteReader)
SetFavoriteRepo wires a favorite reader so Show can return likedCount/isLiked for forPublic public lists (#1550). nil 時は likedCount/isLiked を付与しない。
func (*Handler) SetProxyFollow ¶
func (h *Handler) SetProxyFollow(p ProxyFollowEnqueuer)
SetProxyFollow wires the proxy-follow enqueuer used when a remote user is pushed to a list (#1704). nil 時は proxy follow を skip する。
func (*Handler) SetUserListEventPublisher ¶
func (h *Handler) SetUserListEventPublisher(p UserListEventPublisher)
SetUserListEventPublisher wires the membership event publisher used by push/pull (#1549). nil 時は membership event を発火しない。
func (*Handler) SetUserRepo ¶
func (h *Handler) SetUserRepo(r repository.UserRepository)
SetUserRepo wires a UserRepository so Push can validate the target user's existence (NO_SUCH_USER) before AddMember, matching upstream users/lists/push GetterService.getUser semantics (#1550).
type ProxyFollowEnqueuer ¶
type ProxyFollowEnqueuer interface {
EnqueueProxyFollow(remoteUserIDs []string)
}
ProxyFollowEnqueuer makes the proxy account follow remote users added to a list so their posts federate to this instance (#1704)。実装は core/userlist.ProxyFollower。
type UserListEventPublisher ¶
UserListEventPublisher publishes userAdded/userRemoved membership events to a list's stream so the userList WS channel updates members live (#1549)。実装は stream.UserListStreamPublisher。
type UserListFavoriteReader ¶
type UserListFavoriteReader interface {
CountByList(listID string) (int64, error)
Exists(userID, listID string) (bool, error)
}
UserListFavoriteReader abstracts the favorite count / exists lookup for users/lists/show forPublic の likedCount/isLiked (#1550)。実装は repository.UserListFavoriteRepository。