Codebase list golang-github-go-kit-kit / 9fcaac9 examples / addsvc / thrift_binding.go
9fcaac9

Tree @9fcaac9 (Download .tar.gz)

thrift_binding.go @9fcaac9raw · history · blame

package main

import (
	"github.com/go-kit/kit/examples/addsvc/server"
	thriftadd "github.com/go-kit/kit/examples/addsvc/thrift/gen-go/add"
)

type thriftBinding struct {
	server.AddService
}

func (tb thriftBinding) Sum(a, b int64) (*thriftadd.SumReply, error) {
	v := tb.AddService.Sum(int(a), int(b))
	return &thriftadd.SumReply{Value: int64(v)}, nil
}

func (tb thriftBinding) Concat(a, b string) (*thriftadd.ConcatReply, error) {
	v := tb.AddService.Concat(a, b)
	return &thriftadd.ConcatReply{Value: v}, nil
}