From f0f8336f57a8c1f0621fd2b16b306683b623bda4 Mon Sep 17 00:00:00 2001 From: Nia Weiss Date: Thu, 27 Aug 2020 11:35:54 -0400 Subject: [PATCH] rename postgres.addr to postgres.bind for consistency --- ctl/server.go | 2 +- server/config.go | 4 ++-- server/server.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ctl/server.go b/ctl/server.go index bed61f2ef..23a269612 100644 --- a/ctl/server.go +++ b/ctl/server.go @@ -90,7 +90,7 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) { flags.StringVarP(&srv.Config.Txsrc, "tx", "", "", "transaction/storage to use: one of roaring, rbf, badger, rbf_roaring, roaring_rbf, badger_roaring, roaring_badger, badger_rbf, or rbf_badger (default roaring)") // Postgres endpoint - flags.StringVar(&srv.Config.Postgres.Addr, "postgres.addr", srv.Config.Postgres.Addr, "address to which to bind a postgres endpoint (leave blank to disable)") + flags.StringVar(&srv.Config.Postgres.Bind, "postgres.bind", srv.Config.Postgres.Bind, "Address to which to bind a postgres endpoint (leave blank to disable)") SetTLSConfig(flags, "postgres.", &srv.Config.Postgres.TLS.CertificatePath, &srv.Config.Postgres.TLS.CertificateKeyPath, &srv.Config.Postgres.TLS.CACertPath, &srv.Config.Postgres.TLS.SkipVerify, &srv.Config.Postgres.TLS.EnableClientVerification) flags.DurationVar((*time.Duration)(&srv.Config.Postgres.StartupTimeout), "postgres.startup-timeout", time.Duration(srv.Config.Postgres.StartupTimeout), "Timeout for postgres connection startup. (set 0 to disable)") flags.DurationVar((*time.Duration)(&srv.Config.Postgres.ReadTimeout), "postgres.read-timeout", time.Duration(srv.Config.Postgres.ReadTimeout), "Timeout for reads on a postgres connection. (set 0 to disable; does not include connection idling)") diff --git a/server/config.go b/server/config.go index 7437d65ed..c51a7f95f 100644 --- a/server/config.go +++ b/server/config.go @@ -168,9 +168,9 @@ type Config struct { } `toml:"profile"` Postgres struct { - // Addr is the address to which to bind a postgres endpoint. + // Bind is the address to which to bind a postgres endpoint. // If this is empty, no endpoint will be created. - Addr string `toml:"addr"` + Bind string `toml:"bind"` // TLS configuration for postgres connections. TLS TLSConfig `toml:"tls"` diff --git a/server/server.go b/server/server.go index 7702aca79..546db5d41 100644 --- a/server/server.go +++ b/server/server.go @@ -176,7 +176,7 @@ func (m *Command) Start() (err error) { // Initialize postgres. m.pgserver = nil - if m.Config.Postgres.Addr != "" { + if m.Config.Postgres.Bind != "" { var tlsConf *tls.Config if m.Config.Postgres.TLS.CertificatePath != "" { conf, err := GetTLSConfig(&m.Config.Postgres.TLS, m.logger.Logger()) @@ -191,7 +191,7 @@ func (m *Command) Start() (err error) { m.pgserver.s.WriteTimeout = time.Duration(m.Config.Postgres.WriteTimeout) m.pgserver.s.MaxStartupSize = m.Config.Postgres.MaxStartupSize m.pgserver.s.ConnectionLimit = m.Config.Postgres.ConnectionLimit - err := m.pgserver.Start(m.Config.Postgres.Addr) + err := m.pgserver.Start(m.Config.Postgres.Bind) if err != nil { return errors.Wrap(err, "starting postgres") }