Help us shape the future of Go! Take the 2026 Go Developer Survey

author

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToDB added in v0.0.4

func MapToDB(author Author) db.AuthorDB

func ToDBAuthor added in v0.0.2

func ToDBAuthor(author *Author) *db.AuthorDB

Types

type Author

type Author struct {
	Id        string  `json:"id" example:"a.s8oes9dhwrvt0zif"`
	Name      *string `json:"name" example:"John Doe"`
	ColorId   string  `json:"colorId" example:"#ff0000"`
	Token     *string `json:"token,omitempty"`
	Timestamp int64   `json:"timestamp" example:"1704067200000"`
}

Author represents an Etherpad author @Description An author who can collaborate on pads

func MapFromDB added in v0.0.4

func MapFromDB(authorDB db.AuthorDB) Author

func NewRandomAuthor added in v0.0.2

func NewRandomAuthor() *Author

type Manager

type Manager struct {
	Db db.DataStore
}

func NewManager

func NewManager(db db.DataStore) *Manager

func (*Manager) AnonymizeAuthor added in v0.6.3

func (m *Manager) AnonymizeAuthor(authorId string) error

*

  • AnonymizeAuthor performs GDPR Art. 17 erasure for an author, mirroring the
  • original Etherpad's AuthorManager.anonymizeAuthor (API 1.3.1):
  • - the token binding that links a person to this author id is severed
  • first, so a concurrent token lookup can no longer resolve the author
  • mid-erasure,
  • - the display identity on the author record is zeroed (name -> null,
  • colorId -> 0) while the record itself is kept,
  • - authorship on chat messages the author posted is nulled; the message
  • text itself survives,
  • - pad content, revisions and attribute pools are left intact: changeset
  • references are opaque without the identity record.
  • The operation is idempotent: re-running it leaves the same erased state.
  • Returns db.AuthorNotFoundError if the author does not exist.
  • @param {String} authorId The id of the author

func (*Manager) CreateAuthor

func (m *Manager) CreateAuthor(name *string) (*Author, error)

func (*Manager) GetAuthor

func (m *Manager) GetAuthor(authorId string) (*Author, error)

func (*Manager) GetAuthor4Token

func (m *Manager) GetAuthor4Token(token string) (*Author, error)

func (*Manager) GetAuthorId

func (m *Manager) GetAuthorId(token string) (*Author, error)

func (*Manager) GetAuthorName

func (m *Manager) GetAuthorName(authorId string) (*string, error)

*

  • Returns the name of the author
  • @param {String} author The id of the author

func (*Manager) GetAuthors added in v0.0.4

func (m *Manager) GetAuthors(authorIds []string) (*[]Author, error)

func (*Manager) GetPadsOfAuthor added in v0.0.4

func (m *Manager) GetPadsOfAuthor(authorId string) (*[]string, error)

func (*Manager) ListPadsOfAuthor

func (m *Manager) ListPadsOfAuthor(authorId string) ([]string, error)

*

  • Returns an array of all pads this author contributed to
  • @param {String} authorID The id of the author

func (*Manager) SetAuthorColor

func (m *Manager) SetAuthorColor(author string, colorId string) error

func (*Manager) SetAuthorName

func (m *Manager) SetAuthorName(authorId string, authorName string) error

Jump to

Keyboard shortcuts

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