author

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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

func AnonymizeAuthor added in v0.6.3

func AnonymizeAuthor(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler

AnonymizeAuthor godoc @Summary Anonymize an author (GDPR Art. 17 erasure) @Description Severs the token binding of an author, zeroes their display identity (name, color) and nulls their authorship on chat messages. Pad content and revisions are left intact. Idempotent. @Tags Authors @Accept json @Produce json @Param authorId path string true "Author ID" @Param dryRun query bool false "Only count what would be erased" @Success 200 {object} AnonymizeAuthorResponse @Failure 400 {object} errors.Error @Failure 403 {object} errors.Error "gdprAuthorErasure.enabled is off" @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author/{authorId}/anonymize [post]

func CreateAuthor added in v0.0.5

func CreateAuthor(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler

CreateAuthor godoc @Summary Create a new author @Description Creates a new author with the specified name @Tags Authors @Accept json @Produce json @Param author body CreateDto true "Author data" @Success 200 {object} CreateDtoResponse @Failure 400 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author [post]

func CreateAuthorIfNotExistsFor added in v0.0.5

func CreateAuthorIfNotExistsFor(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler

CreateAuthorIfNotExistsFor godoc @Summary Create an author if not exists for a mapper @Description Creates an author for a mapper if it doesn't exist, otherwise returns existing author ID @Tags Authors @Accept json @Produce json @Param request body CreateAuthorIfNotExistsForRequest true "Author mapper and name" @Success 200 {object} CreateDtoResponse @Failure 400 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author/createIfNotExistsFor [post]

func GetAuthor added in v0.0.5

func GetAuthor(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler

GetAuthor godoc @Summary Get an author @Description Returns the information of an author by their ID @Tags Authors @Accept json @Produce json @Param authorId path string true "Author ID" @Success 200 {object} author.Author @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author/{authorId} [get]

func GetAuthorName added in v0.0.5

func GetAuthorName(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler

GetAuthorName godoc @Summary Get author name @Description Returns the name of an author @Tags Authors @Accept json @Produce json @Param authorId path string true "Author ID" @Success 200 {object} AuthorNameResponse @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Security BearerAuth @Router /admin/api/author/{authorId}/name [get]

func GetAuthorPads added in v0.0.5

func GetAuthorPads(initStore *lib.InitStore, authorManager *author.Manager) fiber.Handler

GetAuthorPads godoc @Summary Get all pads of an author @Description Returns all pad IDs that an author has contributed to @Tags Authors @Accept json @Produce json @Param authorId path string true "Author ID" @Success 200 {array} string @Failure 400 {object} errors.Error @Failure 404 {object} errors.Error @Failure 500 {object} errors.Error @Security BearerAuth @Router /admin/api/author/{authorId}/pads [get]

func Init

func Init(initStore *lib.InitStore)

Types

type AnonymizeAuthorResponse added in v0.6.3

type AnonymizeAuthorResponse struct {
	AuthorId string `json:"authorId" example:"a.s8oes9dhwrvt0zif"`
	// Anonymized is false for a dry run (?dryRun=true), which only counts.
	Anonymized bool `json:"anonymized" example:"true"`
	author.ErasureResult
}

AnonymizeAuthorResponse represents the response after anonymizing an author

type AuthorNameResponse added in v0.0.5

type AuthorNameResponse struct {
	AuthorName string `json:"authorName"`
}

AuthorNameResponse represents the response with author name

type CreateAuthorIfNotExistsForRequest added in v0.0.5

type CreateAuthorIfNotExistsForRequest struct {
	AuthorMapper string `json:"authorMapper" validate:"required"`
	Name         string `json:"name"`
}

CreateAuthorIfNotExistsForRequest represents the request to create an author if not exists

type CreateDto

type CreateDto struct {
	Name string `json:"name" validate:"required" example:"John Doe"`
}

CreateDto represents the request to create an author

type CreateDtoResponse

type CreateDtoResponse struct {
	AuthorId string `json:"authorId" example:"a.s8oes9dhwrvt0zif"`
}

CreateDtoResponse represents the response when creating an author

type PadsResponse added in v0.0.5

type PadsResponse struct {
	PadIds []string `json:"padIds"`
}

PadsResponse represents a list of pad IDs

Jump to

Keyboard shortcuts

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