router

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any2Img

type Any2Img struct {
	api.DrawConfig
	PrePhoto     string `json:"pre_photo,omitempty"`
	ControlPhoto string `json:"control_photo,omitempty"`
}

type ConfigFunc added in v0.2.0

type ConfigFunc func(r *Router)

func WithAPI added in v0.2.0

func WithAPI(handler *handler.Handler) ConfigFunc

func WithDocs added in v0.2.0

func WithDocs() ConfigFunc

func WithWebhook added in v0.2.0

func WithWebhook(webhookUriPath string, webhookHandler func(w http.ResponseWriter, r *http.Request)) ConfigFunc

type CtrlPhotoCfg

type CtrlPhotoCfg struct {
	ControlPhoto []string `json:"control_photo"`
	PreProcessor string   `json:"control_preprocess"`
	ResSize      int      `json:"res_size"`
}

type ExtraModel

type ExtraModel struct {
	Name         string
	Preview      string
	Type         string
	TriggerWords []string
	Group        []string
}

type I18N

type I18N struct {
	Key    string
	Value  string
	Groups string
}

type I18NS

type I18NS []*I18N

type ImagesData

type ImagesData struct {
	MaxCount int64    `json:"maxcount,omitempty"`
	Results  []Result `json:"resoult"`
}

type Resp

type Resp struct {
	Time int64  `json:"time,omitempty"`
	Err  string `json:"err,omitempty"`
	Data any    `json:"data,omitempty"`
}

type Result

type Result struct {
	Id     string `json:"id"`
	Image  string `json:"image"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
	Cfg    any    `json:"cfg"`
}

type Router

type Router struct {
	// contains filtered or unexported fields
}

func New added in v0.2.0

func New(eng *gin.Engine, config ...ConfigFunc) (*Router, error)

func (*Router) Eng added in v0.2.0

func (r *Router) Eng() *gin.Engine

func (*Router) Images added in v0.2.0

func (r *Router) Images(ctx *gin.Context)

Images @Summary Images @Description Images @Tags Images @Param filename path string true "filename" @Success 200 {object} Resp @Failure 500 {object} Resp @Router /images/{filename} [get]

type SuperResolutionCfg

type SuperResolutionCfg struct {
	Photo      []string
	Multiplier int
}

Jump to

Keyboard shortcuts

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