1
0
mirror of https://github.com/chylex/SMTP-Relay.git synced 2024-11-21 12:42:45 +01:00
SMTP-Relay/internal/config/proto.go

23 lines
306 B
Go

package config
import "strings"
type ProtoAddr struct {
Protocol string
Address string
}
func splitProto(s string) ProtoAddr {
idx := strings.Index(s, "://")
if idx == -1 {
return ProtoAddr{
Address: s,
}
} else {
return ProtoAddr{
Protocol: s[0:idx],
Address: s[idx+3:],
}
}
}