| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Command fortuned runs a daemon that implements the Fortune interface. |
| "v.io/x/ref/examples/fortune" |
| // The v23.Init call below will use the generic runtime factory. |
| _ "v.io/x/ref/runtime/factories/generic" |
| name = flag.String("name", "", "Name for fortuned in default mount table") |
| ctx, shutdown := v23.Init() |
| authorizer := security.DefaultAuthorizer() |
| service := fortune.FortuneServer(impl) |
| server, err := xrpc.NewServer(ctx, *name, service, authorizer) |
| log.Panic("Failure creating server: ", err) |
| log.Printf("Listening at: %v\n", server.Status().Endpoints[0]) |
| <-signals.ShutdownOnSignals(ctx) |