mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 18:02:30 +08:00
Codegen: Remove pfs codegen dependency from Grafana codebase (#98840)
* Remove pfs dependency for IAM struct to avoid to import codegen code in main go.mod * Remove pointer * Remove dependency cycle * Update tests
This commit is contained in:
@ -1,38 +1,17 @@
|
||||
package pfs
|
||||
|
||||
type Type string
|
||||
|
||||
// Defines values for Type.
|
||||
const (
|
||||
TypeApp Type = "app"
|
||||
TypeDatasource Type = "datasource"
|
||||
TypePanel Type = "panel"
|
||||
TypeRenderer Type = "renderer"
|
||||
TypeSecretsmanager Type = "secretsmanager"
|
||||
)
|
||||
|
||||
type PluginDef struct {
|
||||
Id string
|
||||
Name string
|
||||
Backend *bool
|
||||
Type Type
|
||||
Type string
|
||||
Info Info
|
||||
IAM IAM
|
||||
}
|
||||
|
||||
type Info struct {
|
||||
Version *string
|
||||
}
|
||||
|
||||
type IAM struct {
|
||||
Permissions []Permission `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
type Permission struct {
|
||||
Action string `json:"action"`
|
||||
Scope *string `json:"scope,omitempty"`
|
||||
}
|
||||
|
||||
func (pd PluginDef) Validate() error {
|
||||
if pd.Id == "" || pd.Name == "" || pd.Type == "" {
|
||||
return ErrInvalidRootFile
|
||||
|
Reference in New Issue
Block a user