request

package
v0.0.0-...-2da20e2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package request ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangePassword

type ChangePassword struct {
	OldPassword string `json:"old_password" z:"OldPassword"`
	NewPassword string `json:"new_password" z:"NewPassword"`
}

ChangePassword represents the request body for changing a user's password.

type ChangeUsername

type ChangeUsername struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

ChangeUsername holds the data required to update a username.

type ConfirmEmail

type ConfirmEmail struct {
	Code string `json:"code"`
}

ConfirmEmail holds the confirmation code for email verification.

type CreateBook

type CreateBook struct {
	Title       string          `json:"title"`
	Summary     string          `json:"summary"`
	Description string          `json:"description"`
	ReleaseDate string          `json:"release_date"`
	Homepage    string          `json:"homepage"`
	CoverFileID ds.ID           `json:"cover_file_id,omitempty,omitzero"`
	Authors     []ds.BookAuthor `json:"authors"`
	Topics      []ds.ID         `json:"topics"`
}

CreateBook defines the request payload for creating a new book entity.

func (*CreateBook) Sanitize

func (r *CreateBook) Sanitize()

Sanitize normalizes and validates CreateBook request.

func (*CreateBook) ToBook

func (r *CreateBook) ToBook() *ds.Book

ToBook converts the CreateBook request into a Book model.

type CreatePage

type CreatePage struct {
	PublicID string `json:"public_id"`
	Title    string `json:"title"`
	Content  string `json:"content"`
}

CreatePage defines the request payload for creating a new page entity.

func (*CreatePage) ToPage

func (r *CreatePage) ToPage() *ds.Page

ToPage converts the CreatePage request into an Entity model.

type DeleteUser

type DeleteUser struct {
	Password string `json:"password"`
}

DeleteUser holds the data required to delete a user account.

type EmailChangeConfirm

type EmailChangeConfirm struct {
	Token string `json:"token"`
}

EmailChangeConfirm represents the request body for confirming an email change.

type EmailChangeRequest

type EmailChangeRequest struct {
	Email string `json:"email"`
}

EmailChangeRequest represents the request body for initiating an email change.

type FilterBooks

type FilterBooks struct {
	FilterEntities

	Author string `json:"author" url:"author,omitempty"`
}

FilterBooks defines filtering options specific to books.

type FilterChangeRequests

type FilterChangeRequests struct {
	Page    int                   `json:"page" url:"page,omitempty"`
	PerPage int                   `json:"per_page" url:"per_page,omitempty"`
	Status  ds.EntityChangeStatus `json:"status" url:"status,omitempty"`
}

FilterChangeRequests defines filtering options specific to change requests.

type FilterEntities

type FilterEntities struct {
	Page       int                   `json:"page" url:"page,omitempty"`
	PerPage    int                   `json:"per_page" url:"per_page,omitempty"`
	Status     []ds.EntityStatus     `json:"s" url:"s,omitempty"`
	Visibility []ds.EntityVisibility `json:"v" url:"v,omitempty"`
	Search     *string               `json:"search" url:"search,omitempty"`
	Topics     []string              `json:"topics" url:"topics,omitempty"`
}

FilterEntities defines common pagination and search parameters.

type FilterEventLogs

type FilterEventLogs struct {
	Page    int `json:"page" url:"page,omitempty"`
	PerPage int `json:"per_page" url:"per_page,omitempty"`
}

FilterEventLogs defines filtering options specific to event logs.

type FilterTopics

type FilterTopics struct {
	Page    int           `json:"page" url:"page,omitempty"`
	PerPage int           `json:"per_page" url:"per_page,omitempty"`
	Type    ds.EntityType `json:"type" url:"type,omitempty"`
}

FilterTopics defines input parameters for filtering and paginating topics.

func (FilterTopics) ToFilter

func (f FilterTopics) ToFilter() ds.TopicsFilter

ToFilter converts FilterTopics into a ds.TopicsFilter.

type PasswordReset

type PasswordReset struct {
	Token    string `json:"token"`
	Password string `json:"password"` //nolint:gosec
}

PasswordReset represents the request body for resetting a password with a token.

type PasswordResetRequest

type PasswordResetRequest struct {
	Email string `json:"email"`
}

PasswordResetRequest represents the request body for initiating a password reset.

type RejectBook

type RejectBook struct {
	Note string `json:"note"`
}

RejectBook represents a request payload for rejecting a book.

type RejectChangeRequest

type RejectChangeRequest struct {
	Note string `json:"note"`
}

RejectChangeRequest represents a request payload for rejecting a change request.

type UpdateBook

type UpdateBook struct {
	CreateBook
}

UpdateBook defines the request payload for updating an existing book. It reuses CreateBook fields as the updatable subset.

type UpdatePage

type UpdatePage struct {
	CreatePage
}

UpdatePage defines the request payload for updating an existing page. It reuses CreatePage fields as the updatable subset.

type UserSignIn

type UserSignIn struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

UserSignIn holds the credentials required to authenticate a user.

type UserSignUp

type UserSignUp struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

UserSignUp holds the data required to register a new user.

Jump to

Keyboard shortcuts

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