grafana/pkg/infra/supportbundles/interface.go
Jo 2c7410c87d
Admin: Add support bundles (#60536)
* Add support bundles

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>

* tweak code owners

* rename and lint frontend

* lint

* fix backend lint

* register feature flag

* add feature toggle. fix small backend issues

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
2022-12-20 11:13:37 +01:00

46 lines
1.0 KiB
Go

package supportbundles
import "context"
type SupportItem struct {
Filename string
FileBytes []byte
}
type State string
const (
StatePending State = "pending"
StateComplete State = "complete"
StateError State = "error"
StateTimeout State = "timeout"
)
func (s State) String() string {
return string(s)
}
type Bundle struct {
UID string `json:"uid"`
State State `json:"state"`
FilePath string `json:"filePath"`
Creator string `json:"creator"`
CreatedAt int64 `json:"createdAt"`
ExpiresAt int64 `json:"expiresAt"`
}
type CollectorFunc func(context.Context) (*SupportItem, error)
type Collector struct {
UID string `json:"uid"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
IncludedByDefault bool `json:"includedByDefault"`
Default bool `json:"default"`
Fn CollectorFunc `json:"-"`
}
type Service interface {
RegisterSupportItemCollector(collector Collector)
}