Documentation ¶
Index ¶
- Variables
- func GetCodeHandle(w http.ResponseWriter, req *http.Request)
- func SaveCode(ctx context.Context, code string, t LangType) (string, error)
- func SaveCodeHandle(w http.ResponseWriter, req *http.Request)
- func Start(client *client.Client)
- type CodeGetter
- type Handle
- type LangType
- type Middleware
- type TempFileContainerFactory
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissParam = errors.New("miss param") ErrBadType = errors.New("code type invalid") )
Functions ¶
func GetCodeHandle ¶
func GetCodeHandle(w http.ResponseWriter, req *http.Request)
func SaveCodeHandle ¶
func SaveCodeHandle(w http.ResponseWriter, req *http.Request)
Types ¶
type CodeGetter ¶
CodeGetter 从 request 中获取用户上传的代码
type Handle ¶
type Handle func(http.ResponseWriter, *http.Request)
func WrapMiddleware ¶
func WrapMiddleware(middleware []Middleware, handle Handle) Handle
WrapMiddleware 将给定的中间件包裹在 handle 上。Slice 中最后一个中间件 最先处理 HTTP 请求
func WrapParseMultipartForm ¶
type Middleware ¶
type TempFileContainerFactory ¶
type TempFileContainerFactory struct { Client *client.Client Getter CodeGetter Writer dockerserver.ResultWriter }
func (TempFileContainerFactory) NewHandleFunc ¶
func (factory TempFileContainerFactory) NewHandleFunc(creator func(*os.File) dockerserver.ContainerCreator) Handle
Click to show internal directories.
Click to hide internal directories.