diff options
Diffstat (limited to 'relay')
-rw-r--r-- | relay/relay.go | 4 | ||||
-rw-r--r-- | relay/session.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/relay/relay.go b/relay/relay.go index b52a923..abd7d93 100644 --- a/relay/relay.go +++ b/relay/relay.go @@ -33,12 +33,12 @@ func (s *Server) RegisterName(ctx context.Context, in *pb.RelayRequest) (*pb.Rel return nil, fmt.Errorf("IP address cannot be empty") } - sessionName := newSession() + sessionName := NewSession() for { if _, ok := table[name(sessionName)]; !ok { break } - sessionName = newSession() + sessionName = NewSession() } table[name(sessionName)] = ips{ip0: in.Ip, ip1: ""} diff --git a/relay/session.go b/relay/session.go index 943c684..a2bc50e 100644 --- a/relay/session.go +++ b/relay/session.go @@ -16,7 +16,7 @@ var nouns = []string{ "crab", "cuckoo", "cymbal", "diplodocus", "donkey", } -func newSession() string { +func NewSession() string { noun := nouns[rand.Intn(len(nouns))] adjective := adjectives[rand.Intn(len(adjectives))] return noun + "-" + adjective |