File: addr.go

package info (click to toggle)
receptor 1.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,772 kB
  • sloc: python: 1,643; makefile: 305; sh: 174
file content (35 lines) | stat: -rw-r--r-- 697 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package netceptor

import "fmt"

// Addr represents an endpoint address on the Netceptor network.
type Addr struct {
	network string
	node    string
	service string
}

// Network returns the network name.
func (a Addr) Network() string {
	return a.network
}

// String formats this address as a string.
func (a Addr) String() string {
	return fmt.Sprintf("%s:%s", a.node, a.service)
}

// SetNetwork sets the network variable.
func (a *Addr) SetNetwork(network string) {
	a.network = network
}

// SetNetwork sets the node variable.
func (a *Addr) SetNode(node string) {
	a.node = node
}

// SetNetwork sets the service variable.
func (a *Addr) SetService(service string) {
	a.service = service
}