userlists

package
v0.0.0-...-9914b64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func (h *Handler) Create(c *echo.Context) error

Create handles POST /api/users/lists/create.

新規作成時は member 0 件なので userIds は []。upstream と同じ packed shape を返す (#871)。

func (*Handler) Delete

func (h *Handler) Delete(c *echo.Context) error

Delete handles POST /api/users/lists/delete.

func (*Handler) List

func (h *Handler) List(c *echo.Context) error

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) Pull

func (h *Handler) Pull(c *echo.Context) error

Pull handles POST /api/users/lists/pull (remove member).

func (*Handler) Push

func (h *Handler) Push(c *echo.Context) error

Push handles POST /api/users/lists/push (add member).

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).

func (*Handler) Show

func (h *Handler) Show(c *echo.Context) error

Show handles POST /api/users/lists/show.

userIds を含む packed shape を返す (#871)。

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

type UserListEventPublisher interface {
	PublishUserListEvent(listID, eventType string, body any)
}

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。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL