mirror of
https://github.com/harness/drone.git
synced 2025-05-11 06:30:06 +08:00
20 lines
386 B
Go
20 lines
386 B
Go
package encrypt
|
|
|
|
import (
|
|
"github.com/harness/gitness/types"
|
|
|
|
"github.com/google/wire"
|
|
)
|
|
|
|
// WireSet provides a wire set for this package.
|
|
var WireSet = wire.NewSet(
|
|
ProvideEncrypter,
|
|
)
|
|
|
|
func ProvideEncrypter(config *types.Config) (Encrypter, error) {
|
|
if config.Encrypter.Secret == "" {
|
|
return &none{}, nil
|
|
}
|
|
return New(config.Encrypter.Secret, config.Encrypter.MixedContent)
|
|
}
|