23 lines
301 B
Go
23 lines
301 B
Go
package processor
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type ginWriter struct {
|
|
ctx *gin.Context
|
|
}
|
|
|
|
func wrapGin(ctx *gin.Context) ginWriter {
|
|
return ginWriter{
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
func (w ginWriter) Write(ctx context.Context, resp any) {
|
|
w.ctx.JSON(http.StatusOK, resp)
|
|
}
|