blob: 81f1ad8ee6b4f417e47f2dce052e10f947fe6a23 [file] [log] [blame]
taozlec0d384a2017-07-17 18:40:42 +02001// +build go1.7
2
3/*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22package main
23
24import (
25 "context"
26 "sync/atomic"
27)
28
29type handler struct{}
30
31func (h *handler) EchoVoid(ctx context.Context) (err error) {
32 atomic.AddInt64(&counter, 1)
33 return nil
34}
35func (h *handler) EchoByte(ctx context.Context, arg int8) (r int8, err error) {
36 atomic.AddInt64(&counter, 1)
37 return arg, nil
38}
39func (h *handler) EchoI32(ctx context.Context, arg int32) (r int32, err error) {
40 atomic.AddInt64(&counter, 1)
41 return arg, nil
42}
43func (h *handler) EchoI64(ctx context.Context, arg int64) (r int64, err error) {
44 atomic.AddInt64(&counter, 1)
45 return arg, nil
46}
47func (h *handler) EchoString(ctx context.Context, arg string) (r string, err error) {
48 atomic.AddInt64(&counter, 1)
49 return arg, nil
50}
51func (h *handler) EchoList(ctx context.Context, arg []int8) (r []int8, err error) {
52 atomic.AddInt64(&counter, 1)
53 return arg, nil
54}
55func (h *handler) EchoSet(ctx context.Context, arg map[int8]struct{}) (r map[int8]struct{}, err error) {
56 atomic.AddInt64(&counter, 1)
57 return arg, nil
58}
59func (h *handler) EchoMap(ctx context.Context, arg map[int8]int8) (r map[int8]int8, err error) {
60 atomic.AddInt64(&counter, 1)
61 return arg, nil
62}