22 lines
383 B
Go
22 lines
383 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
context "context"
|
||
|
)
|
||
|
|
||
|
var ways = &KeyList{}
|
||
|
|
||
|
func init() {
|
||
|
LoadGob("./data/ways.gob", ways)
|
||
|
}
|
||
|
|
||
|
// wayserver can be embedded to have forward compatible implementations.
|
||
|
type wayserver struct {
|
||
|
}
|
||
|
|
||
|
func (ws *wayserver) Name(ctx context.Context, req *Request) (*Reply, error) {
|
||
|
reply := &Reply{}
|
||
|
reply.Message = GetRandomKey(ways).(string)
|
||
|
return reply, nil
|
||
|
}
|