feat(dns): add explicit DNS service constructor aliases
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
32543b2e12
commit
a78523b085
1 changed files with 27 additions and 0 deletions
27
service.go
27
service.go
|
|
@ -169,6 +169,15 @@ type ServiceConfiguration = ServiceOptions
|
|||
// Deprecated: use ServiceConfiguration instead.
|
||||
type ServiceConfig = ServiceOptions
|
||||
|
||||
// DNSServiceOptions is the preferred long-form type name for service configuration.
|
||||
//
|
||||
// service := dns.NewDNSServiceFromOptions(dns.DNSServiceOptions{
|
||||
// Records: map[string]dns.NameRecords{
|
||||
// "gateway.charon.lthn": {A: []string{"10.10.10.10"}},
|
||||
// },
|
||||
// })
|
||||
type DNSServiceOptions = ServiceOptions
|
||||
|
||||
// Options is kept for compatibility with older call sites.
|
||||
//
|
||||
// Deprecated: use ServiceConfiguration instead.
|
||||
|
|
@ -283,6 +292,24 @@ func NewDNSService(options ServiceOptions) *Service {
|
|||
return NewService(options)
|
||||
}
|
||||
|
||||
// NewDNSServiceFromOptions is the explicit long-form constructor name.
|
||||
//
|
||||
// service := dns.NewDNSServiceFromOptions(dns.DNSServiceOptions{
|
||||
// Records: map[string]dns.NameRecords{
|
||||
// "gateway.charon.lthn": {A: []string{"10.10.10.10"}},
|
||||
// },
|
||||
// })
|
||||
func NewDNSServiceFromOptions(options DNSServiceOptions) *Service {
|
||||
return NewDNSService(options)
|
||||
}
|
||||
|
||||
// NewDNSServiceWithContextRegistrar is an explicit constructor name for action wiring.
|
||||
//
|
||||
// service := dns.NewDNSServiceWithContextRegistrar(dns.DNSServiceOptions{}, actionRegistrar)
|
||||
func NewDNSServiceWithContextRegistrar(options DNSServiceOptions, registrar ActionRegistrar) *Service {
|
||||
return NewDNSServiceWithRegistrar(options, registrar)
|
||||
}
|
||||
|
||||
func (service *Service) resolveHSDClient(client *HSDClient) (*HSDClient, error) {
|
||||
if client != nil {
|
||||
return client, nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue