File: host.go

package info (click to toggle)
golang-gopkg-dancannon-gorethink.v1 1.4.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 764 kB
  • sloc: makefile: 3
file content (24 lines) | stat: -rw-r--r-- 350 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package gorethink

import (
	"fmt"
)

// Host name and port of server
type Host struct {
	Name string
	Port int
}

// NewHost create a new Host
func NewHost(name string, port int) Host {
	return Host{
		Name: name,
		Port: port,
	}
}

// Returns host address (name:port)
func (h Host) String() string {
	return fmt.Sprintf("%s:%d", h.Name, h.Port)
}