| 1 | package rethinkdbscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.14 fmt/" |
| 5 | ) |
| 6 | |
| 7 | // Host name and port of server |
| 8 | type Hostscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host# struct { |
| 9 | Namescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#Name. string |
| 10 | Portscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#Port. int |
| 11 | } |
| 12 | |
| 13 | // NewHost create a new Host |
| 14 | func NewHostscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/NewHost().(name string, port int) Hostscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host# { |
| 15 | return Hostscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#{ |
| 16 | Namescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#Name.: name, |
| 17 | Portscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#Port.: port, |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | // Returns host address (name:port) |
| 22 | func (h Hostscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#) Stringscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#String().() string { |
| 23 | return fmtscip-go gomod github.com/golang/go/src go1.14 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.14 fmt/Sprintf().("%s:%d", h.Namescip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#Name., h.Portscip-go gomod gopkg.in/rethinkdb/rethinkdb-go.v6 . `gopkg.in/rethinkdb/rethinkdb-go.v6`/Host#Port.) |
| 24 | } |