go.uber.org/yarpc@v1.72.1/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/common/extendonlyserver/server.go (about) 1 // Code generated by thriftrw-plugin-yarpc 2 // @generated 3 4 package extendonlyserver 5 6 import ( 7 transport "go.uber.org/yarpc/api/transport" 8 thrift "go.uber.org/yarpc/encoding/thrift" 9 baseserviceserver "go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/common/baseserviceserver" 10 ) 11 12 // Interface is the server-side interface for the ExtendOnly service. 13 type Interface interface { 14 baseserviceserver.Interface 15 } 16 17 // New prepares an implementation of the ExtendOnly service for 18 // registration. 19 // 20 // handler := ExtendOnlyHandler{} 21 // dispatcher.Register(extendonlyserver.New(handler)) 22 func New(impl Interface, opts ...thrift.RegisterOption) []transport.Procedure { 23 24 service := thrift.Service{ 25 Name: "ExtendOnly", 26 Methods: []thrift.Method{}, 27 } 28 29 procedures := make([]transport.Procedure, 0, 0) 30 31 procedures = append( 32 procedures, 33 baseserviceserver.New( 34 impl, 35 append( 36 opts, 37 thrift.Named("ExtendOnly"), 38 )..., 39 )..., 40 ) 41 procedures = append(procedures, thrift.BuildProcedures(service, opts...)...) 42 return procedures 43 }