transform.pb.go 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. // Code generated by protoc-gen-go.
  2. // source: transform.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package transform is a generated protocol buffer package.
  6. It is generated from these files:
  7. transform.proto
  8. It has these top-level messages:
  9. ExpandReq
  10. ExpandResp
  11. ShortenReq
  12. ShortenResp
  13. */
  14. package transform
  15. import proto "github.com/golang/protobuf/proto"
  16. import fmt "fmt"
  17. import math "math"
  18. import (
  19. context "golang.org/x/net/context"
  20. grpc "google.golang.org/grpc"
  21. )
  22. // Reference imports to suppress errors if they are not otherwise used.
  23. var _ = proto.Marshal
  24. var _ = fmt.Errorf
  25. var _ = math.Inf
  26. // This is a compile-time assertion to ensure that this generated file
  27. // is compatible with the proto package it is being compiled against.
  28. // A compilation error at this line likely means your copy of the
  29. // proto package needs to be updated.
  30. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  31. type ExpandReq struct {
  32. Shorten string `protobuf:"bytes,1,opt,name=shorten" json:"shorten,omitempty"`
  33. }
  34. func (m *ExpandReq) Reset() { *m = ExpandReq{} }
  35. func (m *ExpandReq) String() string { return proto.CompactTextString(m) }
  36. func (*ExpandReq) ProtoMessage() {}
  37. func (*ExpandReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  38. func (m *ExpandReq) GetShorten() string {
  39. if m != nil {
  40. return m.Shorten
  41. }
  42. return ""
  43. }
  44. type ExpandResp struct {
  45. Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
  46. }
  47. func (m *ExpandResp) Reset() { *m = ExpandResp{} }
  48. func (m *ExpandResp) String() string { return proto.CompactTextString(m) }
  49. func (*ExpandResp) ProtoMessage() {}
  50. func (*ExpandResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
  51. func (m *ExpandResp) GetUrl() string {
  52. if m != nil {
  53. return m.Url
  54. }
  55. return ""
  56. }
  57. type ShortenReq struct {
  58. Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
  59. }
  60. func (m *ShortenReq) Reset() { *m = ShortenReq{} }
  61. func (m *ShortenReq) String() string { return proto.CompactTextString(m) }
  62. func (*ShortenReq) ProtoMessage() {}
  63. func (*ShortenReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
  64. func (m *ShortenReq) GetUrl() string {
  65. if m != nil {
  66. return m.Url
  67. }
  68. return ""
  69. }
  70. type ShortenResp struct {
  71. Shorten string `protobuf:"bytes,1,opt,name=shorten" json:"shorten,omitempty"`
  72. }
  73. func (m *ShortenResp) Reset() { *m = ShortenResp{} }
  74. func (m *ShortenResp) String() string { return proto.CompactTextString(m) }
  75. func (*ShortenResp) ProtoMessage() {}
  76. func (*ShortenResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
  77. func (m *ShortenResp) GetShorten() string {
  78. if m != nil {
  79. return m.Shorten
  80. }
  81. return ""
  82. }
  83. func init() {
  84. proto.RegisterType((*ExpandReq)(nil), "transform.expandReq")
  85. proto.RegisterType((*ExpandResp)(nil), "transform.expandResp")
  86. proto.RegisterType((*ShortenReq)(nil), "transform.shortenReq")
  87. proto.RegisterType((*ShortenResp)(nil), "transform.shortenResp")
  88. }
  89. // Reference imports to suppress errors if they are not otherwise used.
  90. var _ context.Context
  91. var _ grpc.ClientConn
  92. // This is a compile-time assertion to ensure that this generated file
  93. // is compatible with the grpc package it is being compiled against.
  94. const _ = grpc.SupportPackageIsVersion4
  95. // Client API for Transformer service
  96. type TransformerClient interface {
  97. Expand(ctx context.Context, in *ExpandReq, opts ...grpc.CallOption) (*ExpandResp, error)
  98. Shorten(ctx context.Context, in *ShortenReq, opts ...grpc.CallOption) (*ShortenResp, error)
  99. }
  100. type transformerClient struct {
  101. cc *grpc.ClientConn
  102. }
  103. func NewTransformerClient(cc *grpc.ClientConn) TransformerClient {
  104. return &transformerClient{cc}
  105. }
  106. func (c *transformerClient) Expand(ctx context.Context, in *ExpandReq, opts ...grpc.CallOption) (*ExpandResp, error) {
  107. out := new(ExpandResp)
  108. err := grpc.Invoke(ctx, "/transform.transformer/expand", in, out, c.cc, opts...)
  109. if err != nil {
  110. return nil, err
  111. }
  112. return out, nil
  113. }
  114. func (c *transformerClient) Shorten(ctx context.Context, in *ShortenReq, opts ...grpc.CallOption) (*ShortenResp, error) {
  115. out := new(ShortenResp)
  116. err := grpc.Invoke(ctx, "/transform.transformer/shorten", in, out, c.cc, opts...)
  117. if err != nil {
  118. return nil, err
  119. }
  120. return out, nil
  121. }
  122. // Server API for Transformer service
  123. type TransformerServer interface {
  124. Expand(context.Context, *ExpandReq) (*ExpandResp, error)
  125. Shorten(context.Context, *ShortenReq) (*ShortenResp, error)
  126. }
  127. func RegisterTransformerServer(s *grpc.Server, srv TransformerServer) {
  128. s.RegisterService(&_Transformer_serviceDesc, srv)
  129. }
  130. func _Transformer_Expand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  131. in := new(ExpandReq)
  132. if err := dec(in); err != nil {
  133. return nil, err
  134. }
  135. if interceptor == nil {
  136. return srv.(TransformerServer).Expand(ctx, in)
  137. }
  138. info := &grpc.UnaryServerInfo{
  139. Server: srv,
  140. FullMethod: "/transform.transformer/Expand",
  141. }
  142. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  143. return srv.(TransformerServer).Expand(ctx, req.(*ExpandReq))
  144. }
  145. return interceptor(ctx, in, info, handler)
  146. }
  147. func _Transformer_Shorten_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  148. in := new(ShortenReq)
  149. if err := dec(in); err != nil {
  150. return nil, err
  151. }
  152. if interceptor == nil {
  153. return srv.(TransformerServer).Shorten(ctx, in)
  154. }
  155. info := &grpc.UnaryServerInfo{
  156. Server: srv,
  157. FullMethod: "/transform.transformer/Shorten",
  158. }
  159. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  160. return srv.(TransformerServer).Shorten(ctx, req.(*ShortenReq))
  161. }
  162. return interceptor(ctx, in, info, handler)
  163. }
  164. var _Transformer_serviceDesc = grpc.ServiceDesc{
  165. ServiceName: "transform.transformer",
  166. HandlerType: (*TransformerServer)(nil),
  167. Methods: []grpc.MethodDesc{
  168. {
  169. MethodName: "expand",
  170. Handler: _Transformer_Expand_Handler,
  171. },
  172. {
  173. MethodName: "shorten",
  174. Handler: _Transformer_Shorten_Handler,
  175. },
  176. },
  177. Streams: []grpc.StreamDesc{},
  178. Metadata: "transform.proto",
  179. }
  180. func init() { proto.RegisterFile("transform.proto", fileDescriptor0) }
  181. var fileDescriptor0 = []byte{
  182. // 163 bytes of a gzipped FileDescriptorProto
  183. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x29, 0x4a, 0xcc,
  184. 0x2b, 0x4e, 0xcb, 0x2f, 0xca, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0x0b, 0x28,
  185. 0xa9, 0x72, 0x71, 0xa6, 0x56, 0x14, 0x24, 0xe6, 0xa5, 0x04, 0xa5, 0x16, 0x0a, 0x49, 0x70, 0xb1,
  186. 0x17, 0x67, 0xe4, 0x17, 0x95, 0xa4, 0xe6, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xc1, 0xb8,
  187. 0x4a, 0x72, 0x5c, 0x5c, 0x30, 0x65, 0xc5, 0x05, 0x42, 0x02, 0x5c, 0xcc, 0xa5, 0x45, 0x39, 0x50,
  188. 0x35, 0x20, 0x26, 0x48, 0x1e, 0xaa, 0x14, 0x64, 0x0e, 0xa6, 0xbc, 0x3a, 0x17, 0x37, 0x5c, 0xbe,
  189. 0xb8, 0x00, 0xb7, 0x45, 0x46, 0x75, 0x5c, 0xdc, 0x70, 0xc7, 0xa5, 0x16, 0x09, 0x99, 0x72, 0xb1,
  190. 0x41, 0xec, 0x15, 0x12, 0xd1, 0x43, 0xf8, 0x02, 0xee, 0x62, 0x29, 0x51, 0x2c, 0xa2, 0xc5, 0x05,
  191. 0x42, 0x16, 0x70, 0xf3, 0x85, 0x90, 0x55, 0x20, 0x9c, 0x28, 0x25, 0x86, 0x4d, 0xb8, 0xb8, 0x20,
  192. 0x89, 0x0d, 0x1c, 0x42, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x27, 0x78, 0x05, 0x34,
  193. 0x01, 0x00, 0x00,
  194. }