forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
36 lines (29 loc) · 871 Bytes
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package rendering
import (
"context"
"errors"
"time"
"github.com/grafana/grafana/pkg/models"
)
var ErrTimeout = errors.New("Timeout error. You can set timeout in seconds with &timeout url parameter")
var ErrNoRenderer = errors.New("No renderer plugin found nor is an external render server configured")
var ErrPhantomJSNotInstalled = errors.New("PhantomJS executable not found")
type Opts struct {
Width int
Height int
Timeout time.Duration
OrgId int64
UserId int64
OrgRole models.RoleType
Path string
Encoding string
Timezone string
ConcurrentLimit int
}
type RenderResult struct {
FilePath string
}
type renderFunc func(ctx context.Context, options Opts) (*RenderResult, error)
type Service interface {
Render(ctx context.Context, opts Opts) (*RenderResult, error)
}