mirror of
https://github.com/harness/drone.git
synced 2025-05-04 21:30:47 +08:00
26 lines
965 B
Go
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
|
|
}
|