flash

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

Overview

Package flash provides /api/flash/* endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Title       *string   `json:"title"`
	Summary     *string   `json:"summary"`
	Script      *string   `json:"script"`
	Permissions *[]string `json:"permissions"`
	Visibility  string    `json:"visibility"`
}

CreateRequest is the request body for flash/create. summary / permissions は upstream paramDef で required なので pointer で受けて「キー欠如」を検出する (#1548)。空文字 / 空配列は present 扱い (= upstream の required は presence 検査)。

title / script も required だが、本家は空文字列をそのまま保存する。pointer で受けて欠落だけを 400 にする (#3750)。

type DeleteRequest

type DeleteRequest struct {
	FlashID string `json:"flashId"`
}

DeleteRequest is the request body for flash/delete.

type FeaturedRequest

type FeaturedRequest struct {
	Offset jsnum.Int  `json:"offset"`
	Limit  *jsnum.Int `json:"limit"`
}

FeaturedRequest is the request body for flash/featured. Upstream pages it by offset only; the cursors are not read (#3750).

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles flash-related API endpoints.

func NewHandler

func NewHandler(svc *coreflash.Service, userRepo repository.UserRepository, idGen id.Generator, entityPacker *entity.Packer) *Handler

NewHandler creates a new flash Handler. userRepo / idGen are required by list endpoints to embed the `user` (UserLite) and `createdAt` fields that the upstream Misskey frontend expects when rendering Play (Flash) cards. entityPacker is the Packer this Handler packs entities with (#3794).

func (*Handler) Create

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

Create handles POST /api/flash/create.

func (*Handler) Delete

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

Delete handles POST /api/flash/delete.

func (*Handler) Featured

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

Featured handles POST /api/flash/featured.

func (*Handler) IFlashs

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

IFlashs handles POST /api/i/flashs, Elythia's alias of flash/my.

本家の flash/my は ID があれば日付を捨てる (makePaginationQuery) が、本家に無い i/flashs は以前の向きごとの組み合わせを残す (#3369)。

func (*Handler) IFlashsLikes

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

IFlashsLikes handles POST /api/i/flashs/likes, Elythia's alias of flash/my-likes. IFlashs と同じく、以前の向きごとの組み合わせを残す (#3369)。

func (*Handler) Like

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

Like handles POST /api/flash/like.

func (*Handler) My

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

My handles POST /api/flash/my (own list).

frontend Paginator (cursor mode) は untilId / sinceId を forward する (#493)。

func (*Handler) MyLikes

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

MyLikes handles POST /api/flash/my-likes.

upstream Misskey TS は `{id, flash: Flash}` を返す (id = flash_like row id, frontend は it.flash で MkPlayPreview を描画)。mk-go は元々 flatten された Flash 配列を返しており frontend が空表示になっていた。

func (*Handler) Search

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

Search handles POST /api/flash/search.

func (*Handler) SetModLog

func (h *Handler) SetModLog(m ModLogger)

SetModLog wires the moderation log writer used when a moderator deletes another user's flash (#1548).

func (*Handler) SetRoleChecker

func (h *Handler) SetRoleChecker(r RoleChecker)

SetRoleChecker wires the moderator check used by flash/delete (#1548).

func (*Handler) Show

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

Show handles POST /api/flash/show.

frontend MkPlay.vue は user / createdAt / isLiked を読んでカード描画 および「いいね」ボタン状態を決めるので、handler 側で embed する。

func (*Handler) Unlike

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

Unlike handles POST /api/flash/unlike.

func (*Handler) Update

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

Update handles POST /api/flash/update.

type LikeRequest

type LikeRequest struct {
	FlashID string `json:"flashId"`
}

LikeRequest is the request body for flash/like and flash/unlike.

type ModLogger

type ModLogger interface {
	Log(ctx context.Context, moderatorID string, t moderationlog.LogType, info map[string]any)
}

ModLogger records a moderation action. Satisfied by *core/moderationlog.Service. nil 配線時は記録を skip する (#1548)。

type PaginationRequest

type PaginationRequest struct {
	Limit     *jsnum.Int `json:"limit"`
	SinceID   string     `json:"sinceId"`
	UntilID   string     `json:"untilId"`
	SinceDate *jsnum.Int `json:"sinceDate"`
	UntilDate *jsnum.Int `json:"untilDate"`
}

PaginationRequest is the shared body for the cursor-paged list endpoints (flash/my, flash/my-likes and their i/flashs aliases).

offset は本家の paramDef に無いので読まない。limit と sinceDate / untilDate は、本家(ajv の integer)と同じく値が整数の小数を受ける (#3750)。

type RoleChecker

type RoleChecker interface {
	IsModerator(userID string) bool
}

RoleChecker reports whether a user is a moderator. Satisfied by *core/role.Service. nil 配線時は全員 non-moderator 扱い (#1548)。

type SearchRequest

type SearchRequest struct {
	Query     string     `json:"query"`
	Limit     *jsnum.Int `json:"limit"`
	SinceID   string     `json:"sinceId"`
	UntilID   string     `json:"untilId"`
	SinceDate *jsnum.Int `json:"sinceDate"`
	UntilDate *jsnum.Int `json:"untilDate"`
}

SearchRequest is the request body for flash/search.

type ShowRequest

type ShowRequest struct {
	FlashID string `json:"flashId"`
}

ShowRequest is the request body for flash/show.

type UpdateRequest

type UpdateRequest struct {
	FlashID     string    `json:"flashId"`
	Title       *string   `json:"title"`
	Summary     *string   `json:"summary"`
	Script      *string   `json:"script"`
	Permissions *[]string `json:"permissions"`
	Visibility  *string   `json:"visibility"`
}

UpdateRequest is the request body for flash/update.

Jump to

Keyboard shortcuts

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