model

package
v0.0.0-...-4b66723 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCollectionResponse

type BaseCollectionResponse[T IdSingular] struct {
	ID T `json:"id"`
}

Response

type GetByIDRequest

type GetByIDRequest[T IdOrIds] struct {
	Include []string `json:"include" query:"include"`
	ID      T        `json:"-" params:"id" query:"id" validate:"required"`
}

type IdOrIds

type IdOrIds interface {
	IdSingular | IdPlural
}

type IdPlural

type IdPlural interface {
	[]int | []string | []uuid.UUID
}

type IdPluralRequest

type IdPluralRequest[T IdPlural] struct {
	ID T `json:"id" params:"id" query:"id" validate:"required"`
}

type IdSingular

type IdSingular interface {
	int | string | uuid.UUID
}

ID

type IdSingularRequest

type IdSingularRequest[T IdSingular] struct {
	ID T `json:"id" params:"id" query:"id" validate:"required"`
}

type ListRequest

type ListRequest struct {
	PageRequest
	Include []string `json:"include" query:"include"`
}

type Meta

type Meta struct {
	Page *PageMetadata `json:"page,omitempty"`
}

type PageMetadata

type PageMetadata struct {
	Page      int   `json:"page"`
	Size      int   `json:"size"`
	TotalItem int64 `json:"total_item"`
	TotalPage int64 `json:"total_page"`
}

type PageRequest

type PageRequest struct {
	Page int `json:"page" query:"page"`
	Size int `json:"size" query:"size"`
}

Request

type PageResponse

type PageResponse[T any] struct {
	Data         []T          `json:"data,omitempty"`
	PageMetadata PageMetadata `json:"page,omitempty"`
}

type WebResponse

type WebResponse[T any] struct {
	Data   T      `json:"data"`
	Meta   *Meta  `json:"meta,omitempty"`
	Errors string `json:"errors,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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