f929bd51db
if arm build, explain that phantomjs is not included by default in arm
builds. If not explain that phantom js isn't installed correctly
(cherry picked from commit f106de0efd)
36 lines
787 B
Go
36 lines
787 B
Go
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
|
|
}
|
|
|
|
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)
|
|
}
|