refactor: rename config structs (#5459)

This commit is contained in:
Elio Bischof
2023-03-16 17:24:30 +00:00
committed by GitHub
parent 1896f13952
commit 09abf06d4d
27 changed files with 92 additions and 92 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ import (
"github.com/zitadel/zitadel/internal/notification/messages"
)
func InitFSChannel(config FSConfig) (channels.NotificationChannel, error) {
func InitFSChannel(config Config) (channels.NotificationChannel, error) {
if err := os.MkdirAll(config.Path, os.ModePerm); err != nil {
return nil, err
}
+1 -1
View File
@@ -1,6 +1,6 @@
package fs
type FSConfig struct {
type Config struct {
Enabled bool
Compact bool
Path string
@@ -9,7 +9,7 @@ import (
"github.com/zitadel/zitadel/internal/notification/channels"
)
func InitStdoutChannel(config LogConfig) channels.NotificationChannel {
func InitStdoutChannel(config Config) channels.NotificationChannel {
logging.Log("NOTIF-D0164").Debug("successfully initialized stdout email and sms channel")
+1 -1
View File
@@ -1,6 +1,6 @@
package log
type LogConfig struct {
type Config struct {
Enabled bool
Compact bool
}
@@ -22,7 +22,7 @@ type Email struct {
senderName string
}
func InitSMTPChannel(ctx context.Context, getSMTPConfig func(ctx context.Context) (*EmailConfig, error)) (*Email, error) {
func InitSMTPChannel(ctx context.Context, getSMTPConfig func(ctx context.Context) (*Config, error)) (*Email, error) {
smtpConfig, err := getSMTPConfig(ctx)
if err != nil {
return nil, err
@@ -1,6 +1,6 @@
package smtp
type EmailConfig struct {
type Config struct {
SMTP SMTP
Tls bool
From string
@@ -9,7 +9,7 @@ import (
"github.com/zitadel/zitadel/internal/notification/messages"
)
func InitTwilioChannel(config TwilioConfig) channels.NotificationChannel {
func InitTwilioChannel(config Config) channels.NotificationChannel {
client := twilio.NewClient(config.SID, config.Token, nil)
logging.Debug("successfully initialized twilio sms channel")
@@ -1,11 +1,11 @@
package twilio
type TwilioConfig struct {
type Config struct {
SID string
Token string
SenderNumber string
}
func (t *TwilioConfig) IsValid() bool {
func (t *Config) IsValid() bool {
return t.SID != "" && t.Token != "" && t.SenderNumber != ""
}