🎨 update nsq

This commit is contained in:
landaiqing
2024-09-29 11:07:44 +08:00
parent 83b6fb6322
commit 2769467ce2
12 changed files with 138 additions and 111 deletions

View File

@@ -3,10 +3,16 @@ package config
import "fmt"
type NSQ struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Host string `yaml:"host"`
Port int `yaml:"port"`
LookupdHost string `yaml:"lookupd-host"`
LookupdPort int `yaml:"lookupd-port"`
}
func (n *NSQ) Addr() string {
func (n *NSQ) NsqAddr() string {
return fmt.Sprintf("%s:%d", n.Host, n.Port)
}
func (n *NSQ) LookupdAddr() string {
return fmt.Sprintf("%s:%d", n.LookupdHost, n.LookupdPort)
}