mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-07-02 08:27:41 +08:00
chore: upgrade Golang dependencies
This commit is contained in:
+22
-21
@@ -7,68 +7,69 @@ import (
|
||||
|
||||
// ContextMock is a helper for tests.
|
||||
//
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
type ContextMock struct {
|
||||
*Context
|
||||
}
|
||||
|
||||
// SetDirPath sets the context's working directory path.
|
||||
//
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetDirPath("/foo")
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetDirPath("/foo")
|
||||
func (ctx *ContextMock) SetDirPath(path string) {
|
||||
ctx.dirPath = path
|
||||
}
|
||||
|
||||
// SetValues sets the values.
|
||||
//
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetValues(map[string][]string{
|
||||
// "url": {
|
||||
// "foo",
|
||||
// },
|
||||
// })
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetValues(map[string][]string{
|
||||
// "url": {
|
||||
// "foo",
|
||||
// },
|
||||
// })
|
||||
func (ctx *ContextMock) SetValues(values map[string][]string) {
|
||||
ctx.values = values
|
||||
}
|
||||
|
||||
// SetFiles sets the files.
|
||||
//
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetFiles(map[string]string{
|
||||
// "foo": "/foo",
|
||||
// })
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetFiles(map[string]string{
|
||||
// "foo": "/foo",
|
||||
// })
|
||||
func (ctx *ContextMock) SetFiles(files map[string]string) {
|
||||
ctx.files = files
|
||||
}
|
||||
|
||||
// SetCancelled sets if the context is cancelled or not.
|
||||
//
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetCancelled(true)
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetCancelled(true)
|
||||
func (ctx *ContextMock) SetCancelled(cancelled bool) {
|
||||
ctx.cancelled = cancelled
|
||||
}
|
||||
|
||||
// OutputPaths returns the registered output paths.
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// outputPaths := ctx.OutputPaths()
|
||||
//
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// outputPaths := ctx.OutputPaths()
|
||||
func (ctx ContextMock) OutputPaths() []string {
|
||||
return ctx.outputPaths
|
||||
}
|
||||
|
||||
// SetLogger sets the logger.
|
||||
//
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetLogger(zap.NewNop())
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.SetLogger(zap.NewNop())
|
||||
func (ctx *ContextMock) SetLogger(logger *zap.Logger) {
|
||||
ctx.logger = logger
|
||||
}
|
||||
|
||||
// SetEchoContext sets the echo.Context.
|
||||
//
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.setEchoContext(c)
|
||||
// ctx := &api.ContextMock{Context: &api.Context{}}
|
||||
// ctx.setEchoContext(c)
|
||||
func (ctx *ContextMock) SetEchoContext(c echo.Context) {
|
||||
ctx.Context.echoCtx = c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user