handler

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOk                = 0
	StatusBindingError      = 1
	StatusDBError           = 2
	StatusNoImageFoundError = 3
	StatusNotAuthError      = 4
	StatusInternalError     = 5
	StatusS3Error           = 6
)

Variables

View Source
var (
	ErrAuthHeaderNotFound = errors.New("auth header not found")
	ErrPermissionDenied   = errors.New("permission denied")
)

Functions

func AddImageHandler

func AddImageHandler(ctx *gin.Context)

func AddTagToImage

func AddTagToImage(ctx *gin.Context)

func DeleteRichImageHandler added in v0.1.2

func DeleteRichImageHandler(ctx *gin.Context)

func DeleteTagToImage

func DeleteTagToImage(ctx *gin.Context)

func GeneratePreSignUpload

func GeneratePreSignUpload(ctx *gin.Context)

func GenereateToken

func GenereateToken(ctx *gin.Context)

func GetAllTags

func GetAllTags(ctx *gin.Context)

func GetImagesHandler

func GetImagesHandler(ctx *gin.Context)

func GetRandomImageHandler added in v0.1.2

func GetRandomImageHandler(ctx *gin.Context)

func HttpAuthMiddleware

func HttpAuthMiddleware() gin.HandlerFunc

func I18nTagsHandler added in v0.2.0

func I18nTagsHandler(ctx *gin.Context)

func NewICCServer

func NewICCServer() icc.ICCServer

Types

type AddImageRequest

type AddImageRequest struct {
	ImageID    string `json:"image_id"`
	ExternalID string `json:"external_id"`
	Tags       []Tag  `json:"tags"`
}

type GeneratePreSignRequest

type GeneratePreSignRequest struct {
	ExternalID string `json:"external_id,omitempty"`
	ImageType  string `json:"image_type"`
	MD5Sum     string `json:"md5_sum"`
}

type GetImageResponse

type GetImageResponse struct {
	ImageURL  string  `json:"image_url"`
	ImageID   string  `json:"image_id"`
	TagIds    []int32 `json:"tag_ids"`
	UpdatedAt int64   `json:"updated_at"`
}

type GetImagesRequest

type GetImagesRequest struct {
	Before        time.Time `json:"before" form:"before" time_format:"unix"`
	TagIds        []int32   `json:"tag_ids" form:"tag_ids"`
	ExcludeTagIds []int32   `json:"exclude_tag_ids" form:"exclude_tag_ids"`
	Limit         uint      `json:"limit" form:"limit"`
}

type ICCServer

type ICCServer struct {
	icc.UnimplementedICCServer
}

type ImageTagRequest

type ImageTagRequest struct {
	ImageID string `json:"image_id"`
	Tags    []Tag  `json:"tags"`
}

type Tag added in v0.2.0

type Tag struct {
	TagID     int32  `json:"tag_id"`
	TagNameEN string `json:"tag_name_en"`
	TagNameCN string `json:"tag_name_cn"`
	TagNameJP string `json:"tag_name_jp"`
}

type UniformResponse

type UniformResponse struct {
	StatusCode int         `json:"status_code"`
	Message    string      `json:"message"`
	Data       interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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