interface.go 787 B

1234567891011121314151617181920212223242526272829303132333435
  1. package rendering
  2. import (
  3. "context"
  4. "errors"
  5. "time"
  6. "github.com/grafana/grafana/pkg/models"
  7. )
  8. var ErrTimeout = errors.New("Timeout error. You can set timeout in seconds with &timeout url parameter")
  9. var ErrNoRenderer = errors.New("No renderer plugin found nor is an external render server configured")
  10. var ErrPhantomJSNotInstalled = errors.New("PhantomJS executable not found")
  11. type Opts struct {
  12. Width int
  13. Height int
  14. Timeout time.Duration
  15. OrgId int64
  16. UserId int64
  17. OrgRole models.RoleType
  18. Path string
  19. Encoding string
  20. Timezone string
  21. }
  22. type RenderResult struct {
  23. FilePath string
  24. }
  25. type renderFunc func(ctx context.Context, options Opts) (*RenderResult, error)
  26. type Service interface {
  27. Render(ctx context.Context, opts Opts) (*RenderResult, error)
  28. }