mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:17:32 +00:00
refactor: rename config structs (#5459)
This commit is contained in:
@@ -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,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,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 != ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user