main.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2018 The etcd Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // etcd-agent is a program that runs functional-tester agent.
  15. package main
  16. import (
  17. "flag"
  18. "go.etcd.io/etcd/functional/agent"
  19. "go.uber.org/zap"
  20. )
  21. var logger *zap.Logger
  22. func init() {
  23. var err error
  24. logger, err = zap.NewProduction()
  25. if err != nil {
  26. panic(err)
  27. }
  28. }
  29. func main() {
  30. network := flag.String("network", "tcp", "network to serve agent server")
  31. address := flag.String("address", "127.0.0.1:9027", "address to serve agent server")
  32. flag.Parse()
  33. defer logger.Sync()
  34. srv := agent.NewServer(logger, *network, *address)
  35. err := srv.StartServe()
  36. logger.Info("agent exiting", zap.Error(err))
  37. }