request

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToEntitySlice

func ToEntitySlice[R Request[E], E any](requests []R) ([]*E, error)

Types

type BaseRequest

type BaseRequest[E any] struct {
	EntityInstance *E
}

func (*BaseRequest[E]) CopyToEntity

func (b *BaseRequest[E]) CopyToEntity(source any) (*E, error)

type CreateImageRequest

type CreateImageRequest struct {
	BaseRequest[entities.Image] `json:"base_request"`
	S3Key                       string    `json:"s3_key" gorm:"size:255;not null"`
	Url                         string    `json:"url" gorm:"size:512;not null"`
	UserID                      *uint     `json:"user_id" gorm:"index"`
	Size                        int       `json:"size"`
	MimeType                    string    `json:"mime_type" gorm:"size:50"`
	ExpiresAt                   time.Time `json:"expires_at"`
}

func (*CreateImageRequest) ToEntity

func (r *CreateImageRequest) ToEntity() (*entities.Image, error)

type Request

type Request[E any] interface {
	ToEntity() (*E, error)
}

Jump to

Keyboard shortcuts

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