params.go 488 B

123456789101112131415161718192021222324
  1. package params
  2. type Params struct {
  3. *net.Interface
  4. Service host.Service
  5. Domain host.Domain
  6. }
  7. func New(service, domain string, iface *net.Interface) (*Params, error) {
  8. p := new(Params)
  9. if p.service, err = host.String(service).IsServiceVariable(); err != nil {
  10. log.Traceln(errors.Params, service, err)
  11. return nil, err
  12. }
  13. if p.domain, err = host.String(domain).IsDomainVariable(); err != nil {
  14. log.Traceln(errors.Params, domain, err)
  15. return nil, err
  16. }
  17. return p, nil
  18. }