api

package
v0.0.0-...-23905ef Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleConfirmAction

func HandleConfirmAction(c echo.Context) error

HandleConfirmAction 处理确认操作

func HandleConfirmPage

func HandleConfirmPage(c echo.Context) error

HandleConfirmPage 处理确认页面

func HandlePINPage

func HandlePINPage(c echo.Context) error

HandlePINPage 处理PIN设置页面

func HandlePINSetup

func HandlePINSetup(c echo.Context) error

HandlePINSetup 处理PIN设置请求

func StartHttpServer

func StartHttpServer(port int, templateFS embed.FS) error

StartHttpServer 启动HTTP服务器

func StopHttpServer

func StopHttpServer()

StopHttpServer 停止HTTP服务器

Types

type ConfirmActionPayload

type ConfirmActionPayload struct {
	Action  string `json:"action"`
	Request string `json:"request"`
	PIN     string `json:"pin,omitempty"` // 添加PIN字段
}

ConfirmActionPayload /confirm接口的请求体

type ConfirmActionResponse

type ConfirmActionResponse struct {
	Message       string              `json:"message"`
	Status        ConfirmActionStatus `json:"status"`
	ConfirmStatus bool                `json:"confirmStatus"`
}

ConfirmActionResponse 确认操作的响应

type ConfirmActionStatus

type ConfirmActionStatus string
const (
	ConfirmActionStatusSuccess ConfirmActionStatus = "success"
	ConfirmActionStatusError   ConfirmActionStatus = "error"
)

type PINSetupPayload

type PINSetupPayload struct {
	PIN string `json:"pin"`
}

PINSetupPayload PIN设置的请求体

type PINSetupResponse

type PINSetupResponse struct {
	Message string              `json:"message"`
	Status  ConfirmActionStatus `json:"status"`
}

PINSetupResponse PIN设置的响应

type TemplateRenderer

type TemplateRenderer struct {
	Templates *template.Template
}

TemplateRenderer 模板渲染器

func (*TemplateRenderer) Render

func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error

Render 渲染方法

Jump to

Keyboard shortcuts

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