Rendering: Add light theme for errors (#41616)

* Add light theme for error rendering

* Fix lint

* Update images and add rendering_limit_x images
This commit is contained in:
Selene
2021-11-17 12:18:47 +01:00
committed by GitHub
parent dad54d499b
commit 9f7942099b
12 changed files with 111 additions and 6 deletions

View File

@ -19,6 +19,13 @@ const (
RenderPNG RenderType = "png"
)
type Theme string
const (
ThemeLight Theme = "light"
ThemeDark Theme = "dark"
)
type Opts struct {
Width int
Height int
@ -32,6 +39,7 @@ type Opts struct {
ConcurrentLimit int
DeviceScaleFactor float64
Headers map[string][]string
Theme Theme
}
type CSVOpts struct {
@ -63,6 +71,6 @@ type Service interface {
Version() string
Render(ctx context.Context, opts Opts) (*RenderResult, error)
RenderCSV(ctx context.Context, opts CSVOpts) (*RenderCSVResult, error)
RenderErrorImage(error error) (*RenderResult, error)
RenderErrorImage(theme Theme, error error) (*RenderResult, error)
GetRenderUser(key string) (*RenderUser, bool)
}