Documentation
¶
Index ¶
Constants ¶
View Source
const ( // UIDPrefix is the prefix for all operator-managed folder UIDs. // This follows the same convention as datasource UIDs (gs- prefix). UIDPrefix = "gs-" // Description is set on operator-managed folders for human readability. Description = "managed-by: observability-operator" // MaxTitleLength is the maximum length of a Grafana folder title (per segment). // This matches Grafana's API limit of 255 characters. MaxTitleLength = 255 // MaxDepth is the maximum nesting depth for folder hierarchies. // This reflects Grafana's built-in folder nesting limit. MaxDepth = 4 )
Variables ¶
View Source
var ( // ErrInvalidFolderPath is returned when the folder path has leading/trailing slashes or empty segments. ErrInvalidFolderPath = errors.New("invalid folder path: must not have leading/trailing slashes or empty segments") // ErrFolderNameTooLong is returned when a folder name segment exceeds the Grafana title limit. ErrFolderNameTooLong = fmt.Errorf("invalid folder path: segment exceeds maximum length of %d characters", MaxTitleLength) // ErrFolderPathTooDeep is returned when the folder path exceeds the maximum nesting depth. ErrFolderPathTooDeep = fmt.Errorf("invalid folder path: exceeds maximum nesting depth of %d", MaxDepth) )
Functions ¶
func GenerateUID ¶
GenerateUID produces a deterministic UID from the full folder path. Uses gs- prefix + first 6 bytes of SHA256(fullPath) encoded as 12 hex chars.
func IsOperatorManaged ¶
IsOperatorManaged checks if a folder UID belongs to the operator.
func ValidatePath ¶
ValidatePath checks that a folder path is well-formed. Returns an error if the path has leading/trailing slashes or empty segments.
Types ¶
type Folder ¶
type Folder struct {
// contains filtered or unexported fields
}
Folder represents a single Grafana folder managed by the operator.
Click to show internal directories.
Click to hide internal directories.