Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: examples/go/echo_server.go

Issue 1105443002: go: update go build rules (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « examples/go/echo_client.go ('k') | mojo/go/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "log" 8 "log"
9 9
10 "code.google.com/p/go.mobile/app" 10 "code.google.com/p/go.mobile/app"
11 11
12 "mojo/public/go/application" 12 "mojo/public/go/application"
13 "mojo/public/go/bindings" 13 "mojo/public/go/bindings"
14 "mojo/public/go/system" 14 "mojo/public/go/system"
15 15
16 "examples/echo/echo" 16 "examples/echo/echo"
17 ) 17 )
18 18
19 //#include "mojo/public/c/system/types.h" 19 //#include "mojo/public/c/system/types.h"
20 import "C" 20 import "C"
21 21
22 type EchoImpl struct{} 22 type EchoImpl struct{}
23 23
24 func (echo *EchoImpl) EchoString(inValue *string) (outValue *string, err error) { 24 func (echo *EchoImpl) EchoString(inValue *string) (outValue *string, err error) {
25 » log.Println(*inValue) 25 » log.Printf("server: %s\n", *inValue)
26 return inValue, nil 26 return inValue, nil
27 } 27 }
28 28
29 type EchoServerDelegate struct { 29 type EchoServerDelegate struct {
30 stubs []*bindings.Stub 30 stubs []*bindings.Stub
31 } 31 }
32 32
33 func (delegate *EchoServerDelegate) Initialize(context application.Context) {} 33 func (delegate *EchoServerDelegate) Initialize(context application.Context) {}
34 34
35 func (delegate *EchoServerDelegate) Create(request echo.EchoRequest) { 35 func (delegate *EchoServerDelegate) Create(request echo.EchoRequest) {
(...skipping 22 matching lines...) Expand all
58 58
59 //export MojoMain 59 //export MojoMain
60 func MojoMain(handle C.MojoHandle) C.MojoResult { 60 func MojoMain(handle C.MojoHandle) C.MojoResult {
61 application.Run(&EchoServerDelegate{}, system.MojoHandle(handle)) 61 application.Run(&EchoServerDelegate{}, system.MojoHandle(handle))
62 return C.MOJO_RESULT_OK 62 return C.MOJO_RESULT_OK
63 } 63 }
64 64
65 func main() { 65 func main() {
66 app.Run(app.Callbacks{}) 66 app.Run(app.Callbacks{})
67 } 67 }
OLDNEW
« no previous file with comments | « examples/go/echo_client.go ('k') | mojo/go/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698