drone/internal/store/transformation.go
2023-05-17 21:56:23 +02:00

26 lines
965 B
Go

// Copyright 2022 Harness Inc. All rights reserved.
// Use of this source code is governed by the Polyform Free Trial License
// that can be found in the LICENSE.md file for this repository.
package store
import (
"strings"
)
// PrincipalUIDTransformation transforms a principalUID to a value that should be duplicate free.
// This allows us to simply switch between principalUIDs being case sensitive, insensitive or anything in between.
type PrincipalUIDTransformation func(uid string) (string, error)
func ToLowerPrincipalUIDTransformation(uid string) (string, error) {
return strings.ToLower(uid), nil
}
// PathTransformation transforms a path to a value that should be duplicate free.
// This allows us to simply switch between paths being case sensitive, insensitive or anything in between.
type PathTransformation func(string) (string, error)
func ToLowerPathTransformation(original string) (string, error) {
return strings.ToLower(original), nil
}