interface.go 871 B

123456789101112131415161718192021222324252627282930313233343536
  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. ConcurrentLimit int
  22. }
  23. type RenderResult struct {
  24. FilePath string
  25. }
  26. type renderFunc func(ctx context.Context, options Opts) (*RenderResult, error)
  27. type Service interface {
  28. Render(ctx context.Context, opts Opts) (*RenderResult, error)
  29. }