go.uber.org/yarpc@v1.72.1/encoding/thrift/thriftrw-plugin-yarpc/internal/tests/extends/fooserver/server.go (about)

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