mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
* 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>
46 lines
1.0 KiB
Go
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)
|
|
}
|