MCPcopy
hub / github.com/CodisLabs/codis / NewConn

Function NewConn

extern/deprecated/redis-test/utils.go:37–46  ·  view source on GitHub ↗
(addr string)

Source from the content-addressed store, hash-verified

35}
36
37func NewConn(addr string) *Conn {
38 if t, err := net.ResolveTCPAddr("tcp", addr); err != nil {
39 Panic("parse tcp addr = %s, error = '%s'", addr, err)
40 } else if conn, err := redis.Dial("tcp", addr); err != nil {
41 Panic("connect to '%s' error = '%s'", addr, err)
42 } else {
43 return &Conn{conn, t.IP.String(), t.Port}
44 }
45 return nil
46}
47
48func (c *Conn) Addr() string {
49 return c.Host + ":" + strconv.Itoa(c.Port)

Callers 15

mainMethod · 0.70
playerMethod · 0.70
playerMethod · 0.70
playerMethod · 0.70
playerMethod · 0.70
playerMethod · 0.70
mainMethod · 0.70
playerMethod · 0.70
mainMethod · 0.70
playerMethod · 0.70
mainMethod · 0.70
mainMethod · 0.70

Calls 2

PanicFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected