extend Service interface to require AddFlags
Now that all services are converted to AddFlags, we can define this
requirement in Service interface. With previously added compile-time
checking, this ensures each service handles it's options in
standardized manner.
@@ -29,9 +29,7 @@ import (
type Service interface {
Run()
- // TODO(mpolednik): uncomment initOptions when all services implement it.
- // AddFlags()
-
+ AddFlags()
}
type ServiceListen struct {
@@ -40,15 +38,6 @@ type ServiceListen struct {
Port int
}
-// TODO(mpolednik): remove this when all affected services use new flag handling.
-func NewServiceListen(name string, host *string, port *int) *ServiceListen {
- return &ServiceListen{
- Name: name,
- Host: *host,
- Port: *port,
- }
-}
-
func (service *ServiceListen) Address() string {
return fmt.Sprintf("%s:%s", service.Host, strconv.Itoa(service.Port))
}
