response

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(c *gin.Context, response EmptyResponse)

func JSON

func JSON[T Payload](c *gin.Context, response JSONResponse[T])

func Text

func Text(c *gin.Context, response TextResponse)

Types

type CreateCacheEntryPayload

type CreateCacheEntryPayload struct {
	SignedUploadURL string `json:"signed_upload_url"`
}

type EmptyPayload

type EmptyPayload struct{}

type EmptyResponse

type EmptyResponse interface {
	StatusCode() int
	Headers() map[string]string
}

func AzureCreated

func AzureCreated(requestID string) EmptyResponse

type ErrorPayload

type ErrorPayload struct {
	Error string `json:"error"`
}

type FinalizeCacheEntryUploadPayload

type FinalizeCacheEntryUploadPayload struct {
	EntryID string `json:"entry_id"`
}

type GetCacheEntryDownloadURLPayload

type GetCacheEntryDownloadURLPayload struct {
	SignedDownloadURL string `json:"signed_download_url"`
	MatchedKey        string `json:"matched_key"`
}

type JSONBody

type JSONBody[T Payload] struct {
	// contains filtered or unexported fields
}

func (JSONBody[T]) MarshalJSON

func (b JSONBody[T]) MarshalJSON() ([]byte, error)

type JSONResponse

type JSONResponse[T Payload] interface {
	StatusCode() int
	Body() JSONBody[T]
}

func CacheMiss

func CacheMiss() JSONResponse[EmptyPayload]

func CreateCacheEntry

func CreateCacheEntry(uploadURL string) JSONResponse[CreateCacheEntryPayload]

func Error

func Error(status int, message string) JSONResponse[ErrorPayload]

func FinalizeCacheEntryUpload

func FinalizeCacheEntryUpload(entryID string) JSONResponse[FinalizeCacheEntryUploadPayload]

func GetCacheEntryDownloadURL

func GetCacheEntryDownloadURL(downloadURL, matchedKey string) JSONResponse[GetCacheEntryDownloadURLPayload]

func NotImplemented

func NotImplemented() JSONResponse[ErrorPayload]

type Payload

type Payload interface {
	// contains filtered or unexported methods
}

type TextResponse

type TextResponse interface {
	StatusCode() int
	Text() string
}

func PlainOK

func PlainOK(body string) TextResponse

Jump to

Keyboard shortcuts

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