Initial commit
This commit is contained in:
43
internal/domains/dialer/dialer.go
Normal file
43
internal/domains/dialer/dialer.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package dialer
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"source.hodakov.me/hdkv/deconnect/internal/application"
|
||||
"source.hodakov.me/hdkv/deconnect/internal/domains"
|
||||
)
|
||||
|
||||
var (
|
||||
_ domains.Dialer = new(Dialer)
|
||||
_ domains.Domain = new(Dialer)
|
||||
)
|
||||
|
||||
type Dialer struct {
|
||||
app *application.App
|
||||
|
||||
dialURL *url.URL
|
||||
}
|
||||
|
||||
func New(app *application.App) *Dialer {
|
||||
return &Dialer{
|
||||
app: app,
|
||||
}
|
||||
}
|
||||
|
||||
func (d *Dialer) ConnectDependencies() error {
|
||||
dialURL, err := d.UpstreamURL()
|
||||
if err != nil {
|
||||
return fmt.Errorf(
|
||||
"%w: %w (%w)", ErrDialer, ErrConnectDependencies, err,
|
||||
)
|
||||
}
|
||||
|
||||
d.dialURL = dialURL
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *Dialer) Start() error {
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user