handler

package
v0.0.0-...-9f73af6 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_USER = "default"
View Source
const (
	FcAsyncKey = "X-Fc-Invocation-Type"
)

Variables

This section is empty.

Functions

func ApiAuth

func ApiAuth() gin.HandlerFunc

func ReverseProxy

func ReverseProxy(c *gin.Context)

func Stat

func Stat() gin.HandlerFunc

Stat cost code

Types

type AgentHandler

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

func NewAgentHandler

func NewAgentHandler(taskStore datastore.Datastore,
	modelStore datastore.Datastore, configStore datastore.Datastore,
	listenTask *module.ListenDbTask) *AgentHandler

func (*AgentHandler) BatchUpdateResource

func (a *AgentHandler) BatchUpdateResource(c *gin.Context)

BatchUpdateResource update sd function resource by batch, Supports a specified list of functions, or all (POST /batch_update_sd_resource)

func (*AgentHandler) CancelTask

func (a *AgentHandler) CancelTask(c *gin.Context, taskId string)

CancelTask cancel predict task, not support (GET /tasks/{taskId}/cancellation)

func (*AgentHandler) DelSDFunc

func (p *AgentHandler) DelSDFunc(c *gin.Context)

DelSDFunc delete sd function (POST /del/sd/functions)

func (*AgentHandler) DeleteModel

func (a *AgentHandler) DeleteModel(c *gin.Context, modelName string)

DeleteModel delete model, not support (DELETE /models/{model_name})

func (*AgentHandler) ExtraImages

func (a *AgentHandler) ExtraImages(c *gin.Context)

ExtraImages image upcaling (POST /extra_images)

func (*AgentHandler) GetModel

func (a *AgentHandler) GetModel(c *gin.Context, modelName string)

GetModel get model info, not support (GET /models/{model_name})

func (*AgentHandler) GetTaskProgress

func (a *AgentHandler) GetTaskProgress(c *gin.Context, taskId string)

GetTaskProgress get predict progress, not support (GET /tasks/{taskId}/progress)

func (*AgentHandler) GetTaskResult

func (a *AgentHandler) GetTaskResult(c *gin.Context, taskId string)

GetTaskResult get predict result, not support (GET /tasks/{taskId}/result)

func (*AgentHandler) Img2Img

func (a *AgentHandler) Img2Img(c *gin.Context)

Img2Img img to img predict (POST /img2img)

func (*AgentHandler) ListModels

func (a *AgentHandler) ListModels(c *gin.Context)

ListModels list model, not support (GET /models)

func (*AgentHandler) ListSdFunc

func (a *AgentHandler) ListSdFunc(c *gin.Context)

ListSdFunc get sdapi function (GET /list/sdapi/functions)

func (*AgentHandler) Login

func (a *AgentHandler) Login(c *gin.Context)

Login user login (POST /login)

func (*AgentHandler) NoRouterAgentHandler

func (a *AgentHandler) NoRouterAgentHandler(c *gin.Context)

func (*AgentHandler) RegisterModel

func (a *AgentHandler) RegisterModel(c *gin.Context)

RegisterModel register model, not support (POST /models)

func (*AgentHandler) Restart

func (a *AgentHandler) Restart(c *gin.Context)

Restart user login (POST /restart)

func (*AgentHandler) Txt2Img

func (a *AgentHandler) Txt2Img(c *gin.Context)

Txt2Img txt to img predict (POST /txt2img)

func (*AgentHandler) UpdateModel

func (a *AgentHandler) UpdateModel(c *gin.Context, modelName string)

UpdateModel update model, not support (PUT /models/{model_name})

func (*AgentHandler) UpdateOptions

func (a *AgentHandler) UpdateOptions(c *gin.Context)

UpdateOptions update config options (POST /options)

type ProxyHandler

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

func NewProxyHandler

func NewProxyHandler(taskStore datastore.Datastore,
	modelStore datastore.Datastore, userStore datastore.Datastore,
	configStore datastore.Datastore, functionStore datastore.Datastore) *ProxyHandler

func (*ProxyHandler) BatchUpdateResource

func (p *ProxyHandler) BatchUpdateResource(c *gin.Context)

BatchUpdateResource update sd function resource by batch, Supports a specified list of functions, or all (POST /batch_update_sd_resource)

func (*ProxyHandler) CancelTask

func (p *ProxyHandler) CancelTask(c *gin.Context, taskId string)

CancelTask predict task (POST /tasks/{taskId}/cancellation)

func (*ProxyHandler) DelSDFunc

func (p *ProxyHandler) DelSDFunc(c *gin.Context)

DelSDFunc delete sd function (POST /del/sd/functions)

func (*ProxyHandler) DeleteModel

func (p *ProxyHandler) DeleteModel(c *gin.Context, modelName string)

DeleteModel delete model (DELETE /models/{model_name})

func (*ProxyHandler) ExtraImages

func (p *ProxyHandler) ExtraImages(c *gin.Context)

ExtraImages image upcaling (POST /extra_images)

func (*ProxyHandler) GetModel

func (p *ProxyHandler) GetModel(c *gin.Context, modelName string)

GetModel get model info (GET /models/{model_name})

func (*ProxyHandler) GetTaskProgress

func (p *ProxyHandler) GetTaskProgress(c *gin.Context, taskId string)

GetTaskProgress get predict progress (GET /tasks/{taskId}/progress)

func (*ProxyHandler) GetTaskResult

func (p *ProxyHandler) GetTaskResult(c *gin.Context, taskId string)

GetTaskResult get predict progress (GET /tasks/{taskId}/result)

func (*ProxyHandler) Img2Img

func (p *ProxyHandler) Img2Img(c *gin.Context)

Img2Img img to img predict (POST /img2img)

func (*ProxyHandler) ListModels

func (p *ProxyHandler) ListModels(c *gin.Context)

ListModels list model (GET /models)

func (*ProxyHandler) ListSdFunc

func (p *ProxyHandler) ListSdFunc(c *gin.Context)

ListSdFunc get sdapi function (GET /list/sdapi/functions)

func (*ProxyHandler) Login

func (p *ProxyHandler) Login(c *gin.Context)

Login user login (POST /login)

func (*ProxyHandler) NoRouterHandler

func (p *ProxyHandler) NoRouterHandler(c *gin.Context)

func (*ProxyHandler) RegisterModel

func (p *ProxyHandler) RegisterModel(c *gin.Context)

RegisterModel upload model (POST /models)

func (*ProxyHandler) Restart

func (p *ProxyHandler) Restart(c *gin.Context)

Restart restart webui api server (POST /restart)

func (*ProxyHandler) Txt2Img

func (p *ProxyHandler) Txt2Img(c *gin.Context)

Txt2Img txt to img predict (POST /txt2img)

func (*ProxyHandler) UpdateModel

func (p *ProxyHandler) UpdateModel(c *gin.Context, modelName string)

UpdateModel update model (PUT /models/{model_name})

func (*ProxyHandler) UpdateOptions

func (p *ProxyHandler) UpdateOptions(c *gin.Context)

UpdateOptions update config options (POST /options)

Jump to

Keyboard shortcuts

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