Documentation ¶
Overview ¶
Package product is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterProductServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProductServiceClient) error
- func RegisterProductServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterProductServiceServer(s *grpc.Server, srv ProductServiceServer)
- type ListLikesRequest
- func (*ListLikesRequest) Descriptor() ([]byte, []int)
- func (this *ListLikesRequest) Equal(that interface{}) bool
- func (m *ListLikesRequest) GetName() string
- func (m *ListLikesRequest) GetP() string
- func (m *ListLikesRequest) GetPageSize() int32
- func (m *ListLikesRequest) GetPageToken() string
- func (m *ListLikesRequest) Marshal() (dAtA []byte, err error)
- func (m *ListLikesRequest) MarshalTo(dAtA []byte) (int, error)
- func (*ListLikesRequest) ProtoMessage()
- func (m *ListLikesRequest) Reset()
- func (m *ListLikesRequest) Size() (n int)
- func (m *ListLikesRequest) String() string
- func (m *ListLikesRequest) Unmarshal(dAtA []byte) error
- func (this *ListLikesRequest) Validate() error
- func (m *ListLikesRequest) XXX_DiscardUnknown()
- func (m *ListLikesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListLikesRequest) XXX_Merge(src proto.Message)
- func (m *ListLikesRequest) XXX_Size() int
- func (m *ListLikesRequest) XXX_Unmarshal(b []byte) error
- type ListLikesResponse
- func (*ListLikesResponse) Descriptor() ([]byte, []int)
- func (this *ListLikesResponse) Equal(that interface{}) bool
- func (m *ListLikesResponse) GetNextPageToken() string
- func (m *ListLikesResponse) GetProducts() []*Product
- func (m *ListLikesResponse) Marshal() (dAtA []byte, err error)
- func (m *ListLikesResponse) MarshalTo(dAtA []byte) (int, error)
- func (*ListLikesResponse) ProtoMessage()
- func (m *ListLikesResponse) Reset()
- func (m *ListLikesResponse) Size() (n int)
- func (m *ListLikesResponse) String() string
- func (m *ListLikesResponse) Unmarshal(dAtA []byte) error
- func (this *ListLikesResponse) Validate() error
- func (m *ListLikesResponse) XXX_DiscardUnknown()
- func (m *ListLikesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListLikesResponse) XXX_Merge(src proto.Message)
- func (m *ListLikesResponse) XXX_Size() int
- func (m *ListLikesResponse) XXX_Unmarshal(b []byte) error
- type ListSimilarsRequest
- func (*ListSimilarsRequest) Descriptor() ([]byte, []int)
- func (this *ListSimilarsRequest) Equal(that interface{}) bool
- func (m *ListSimilarsRequest) GetName() string
- func (m *ListSimilarsRequest) GetP() string
- func (m *ListSimilarsRequest) GetPageSize() int32
- func (m *ListSimilarsRequest) GetPageToken() string
- func (m *ListSimilarsRequest) Marshal() (dAtA []byte, err error)
- func (m *ListSimilarsRequest) MarshalTo(dAtA []byte) (int, error)
- func (*ListSimilarsRequest) ProtoMessage()
- func (m *ListSimilarsRequest) Reset()
- func (m *ListSimilarsRequest) Size() (n int)
- func (m *ListSimilarsRequest) String() string
- func (m *ListSimilarsRequest) Unmarshal(dAtA []byte) error
- func (this *ListSimilarsRequest) Validate() error
- func (m *ListSimilarsRequest) XXX_DiscardUnknown()
- func (m *ListSimilarsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListSimilarsRequest) XXX_Merge(src proto.Message)
- func (m *ListSimilarsRequest) XXX_Size() int
- func (m *ListSimilarsRequest) XXX_Unmarshal(b []byte) error
- type ListSimilarsResponse
- func (*ListSimilarsResponse) Descriptor() ([]byte, []int)
- func (this *ListSimilarsResponse) Equal(that interface{}) bool
- func (m *ListSimilarsResponse) GetNextPageToken() string
- func (m *ListSimilarsResponse) GetProducts() []*Product
- func (m *ListSimilarsResponse) Marshal() (dAtA []byte, err error)
- func (m *ListSimilarsResponse) MarshalTo(dAtA []byte) (int, error)
- func (*ListSimilarsResponse) ProtoMessage()
- func (m *ListSimilarsResponse) Reset()
- func (m *ListSimilarsResponse) Size() (n int)
- func (m *ListSimilarsResponse) String() string
- func (m *ListSimilarsResponse) Unmarshal(dAtA []byte) error
- func (this *ListSimilarsResponse) Validate() error
- func (m *ListSimilarsResponse) XXX_DiscardUnknown()
- func (m *ListSimilarsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListSimilarsResponse) XXX_Merge(src proto.Message)
- func (m *ListSimilarsResponse) XXX_Size() int
- func (m *ListSimilarsResponse) XXX_Unmarshal(b []byte) error
- type Product
- func (*Product) Descriptor() ([]byte, []int)
- func (this *Product) Equal(that interface{}) bool
- func (m *Product) GetDescriptionDetail() *types.StringValue
- func (m *Product) GetID() *types.Int64Value
- func (m *Product) GetName() string
- func (m *Product) Marshal() (dAtA []byte, err error)
- func (m *Product) MarshalTo(dAtA []byte) (int, error)
- func (*Product) ProtoMessage()
- func (m *Product) Reset()
- func (m *Product) Size() (n int)
- func (m *Product) String() string
- func (m *Product) Unmarshal(dAtA []byte) error
- func (this *Product) Validate() error
- func (m *Product) XXX_DiscardUnknown()
- func (m *Product) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Product) XXX_Merge(src proto.Message)
- func (m *Product) XXX_Size() int
- func (m *Product) XXX_Unmarshal(b []byte) error
- type ProductServiceClient
- type ProductServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthProduct = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowProduct = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterProductServiceHandler ¶
func RegisterProductServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterProductServiceHandler registers the http handlers for service ProductService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterProductServiceHandlerClient ¶
func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProductServiceClient) error
RegisterProductServiceHandlerClient registers the http handlers for service ProductService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProductServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProductServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProductServiceClient" to call the correct interceptors.
func RegisterProductServiceHandlerFromEndpoint ¶
func RegisterProductServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterProductServiceHandlerFromEndpoint is same as RegisterProductServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterProductServiceServer ¶
func RegisterProductServiceServer(s *grpc.Server, srv ProductServiceServer)
Types ¶
type ListLikesRequest ¶
type ListLikesRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` P string `protobuf:"bytes,100,opt,name=p,proto3" json:"p,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewPopulatedListLikesRequest ¶
func NewPopulatedListLikesRequest(r randyProduct, easy bool) *ListLikesRequest
func (*ListLikesRequest) Descriptor ¶
func (*ListLikesRequest) Descriptor() ([]byte, []int)
func (*ListLikesRequest) Equal ¶
func (this *ListLikesRequest) Equal(that interface{}) bool
func (*ListLikesRequest) GetName ¶
func (m *ListLikesRequest) GetName() string
func (*ListLikesRequest) GetP ¶
func (m *ListLikesRequest) GetP() string
func (*ListLikesRequest) GetPageSize ¶
func (m *ListLikesRequest) GetPageSize() int32
func (*ListLikesRequest) GetPageToken ¶
func (m *ListLikesRequest) GetPageToken() string
func (*ListLikesRequest) Marshal ¶
func (m *ListLikesRequest) Marshal() (dAtA []byte, err error)
func (*ListLikesRequest) ProtoMessage ¶
func (*ListLikesRequest) ProtoMessage()
func (*ListLikesRequest) Reset ¶
func (m *ListLikesRequest) Reset()
func (*ListLikesRequest) Size ¶
func (m *ListLikesRequest) Size() (n int)
func (*ListLikesRequest) String ¶
func (m *ListLikesRequest) String() string
func (*ListLikesRequest) Unmarshal ¶
func (m *ListLikesRequest) Unmarshal(dAtA []byte) error
func (*ListLikesRequest) Validate ¶
func (this *ListLikesRequest) Validate() error
func (*ListLikesRequest) XXX_DiscardUnknown ¶
func (m *ListLikesRequest) XXX_DiscardUnknown()
func (*ListLikesRequest) XXX_Marshal ¶
func (m *ListLikesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListLikesRequest) XXX_Merge ¶
func (m *ListLikesRequest) XXX_Merge(src proto.Message)
func (*ListLikesRequest) XXX_Size ¶
func (m *ListLikesRequest) XXX_Size() int
func (*ListLikesRequest) XXX_Unmarshal ¶
func (m *ListLikesRequest) XXX_Unmarshal(b []byte) error
type ListLikesResponse ¶
type ListLikesResponse struct { Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewPopulatedListLikesResponse ¶
func NewPopulatedListLikesResponse(r randyProduct, easy bool) *ListLikesResponse
func (*ListLikesResponse) Descriptor ¶
func (*ListLikesResponse) Descriptor() ([]byte, []int)
func (*ListLikesResponse) Equal ¶
func (this *ListLikesResponse) Equal(that interface{}) bool
func (*ListLikesResponse) GetNextPageToken ¶
func (m *ListLikesResponse) GetNextPageToken() string
func (*ListLikesResponse) GetProducts ¶
func (m *ListLikesResponse) GetProducts() []*Product
func (*ListLikesResponse) Marshal ¶
func (m *ListLikesResponse) Marshal() (dAtA []byte, err error)
func (*ListLikesResponse) MarshalTo ¶
func (m *ListLikesResponse) MarshalTo(dAtA []byte) (int, error)
func (*ListLikesResponse) ProtoMessage ¶
func (*ListLikesResponse) ProtoMessage()
func (*ListLikesResponse) Reset ¶
func (m *ListLikesResponse) Reset()
func (*ListLikesResponse) Size ¶
func (m *ListLikesResponse) Size() (n int)
func (*ListLikesResponse) String ¶
func (m *ListLikesResponse) String() string
func (*ListLikesResponse) Unmarshal ¶
func (m *ListLikesResponse) Unmarshal(dAtA []byte) error
func (*ListLikesResponse) Validate ¶
func (this *ListLikesResponse) Validate() error
func (*ListLikesResponse) XXX_DiscardUnknown ¶
func (m *ListLikesResponse) XXX_DiscardUnknown()
func (*ListLikesResponse) XXX_Marshal ¶
func (m *ListLikesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListLikesResponse) XXX_Merge ¶
func (m *ListLikesResponse) XXX_Merge(src proto.Message)
func (*ListLikesResponse) XXX_Size ¶
func (m *ListLikesResponse) XXX_Size() int
func (*ListLikesResponse) XXX_Unmarshal ¶
func (m *ListLikesResponse) XXX_Unmarshal(b []byte) error
type ListSimilarsRequest ¶
type ListSimilarsRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` P string `protobuf:"bytes,100,opt,name=p,proto3" json:"p,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewPopulatedListSimilarsRequest ¶
func NewPopulatedListSimilarsRequest(r randyProduct, easy bool) *ListSimilarsRequest
func (*ListSimilarsRequest) Descriptor ¶
func (*ListSimilarsRequest) Descriptor() ([]byte, []int)
func (*ListSimilarsRequest) Equal ¶
func (this *ListSimilarsRequest) Equal(that interface{}) bool
func (*ListSimilarsRequest) GetName ¶
func (m *ListSimilarsRequest) GetName() string
func (*ListSimilarsRequest) GetP ¶
func (m *ListSimilarsRequest) GetP() string
func (*ListSimilarsRequest) GetPageSize ¶
func (m *ListSimilarsRequest) GetPageSize() int32
func (*ListSimilarsRequest) GetPageToken ¶
func (m *ListSimilarsRequest) GetPageToken() string
func (*ListSimilarsRequest) Marshal ¶
func (m *ListSimilarsRequest) Marshal() (dAtA []byte, err error)
func (*ListSimilarsRequest) MarshalTo ¶
func (m *ListSimilarsRequest) MarshalTo(dAtA []byte) (int, error)
func (*ListSimilarsRequest) ProtoMessage ¶
func (*ListSimilarsRequest) ProtoMessage()
func (*ListSimilarsRequest) Reset ¶
func (m *ListSimilarsRequest) Reset()
func (*ListSimilarsRequest) Size ¶
func (m *ListSimilarsRequest) Size() (n int)
func (*ListSimilarsRequest) String ¶
func (m *ListSimilarsRequest) String() string
func (*ListSimilarsRequest) Unmarshal ¶
func (m *ListSimilarsRequest) Unmarshal(dAtA []byte) error
func (*ListSimilarsRequest) Validate ¶
func (this *ListSimilarsRequest) Validate() error
func (*ListSimilarsRequest) XXX_DiscardUnknown ¶
func (m *ListSimilarsRequest) XXX_DiscardUnknown()
func (*ListSimilarsRequest) XXX_Marshal ¶
func (m *ListSimilarsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListSimilarsRequest) XXX_Merge ¶
func (m *ListSimilarsRequest) XXX_Merge(src proto.Message)
func (*ListSimilarsRequest) XXX_Size ¶
func (m *ListSimilarsRequest) XXX_Size() int
func (*ListSimilarsRequest) XXX_Unmarshal ¶
func (m *ListSimilarsRequest) XXX_Unmarshal(b []byte) error
type ListSimilarsResponse ¶
type ListSimilarsResponse struct { Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewPopulatedListSimilarsResponse ¶
func NewPopulatedListSimilarsResponse(r randyProduct, easy bool) *ListSimilarsResponse
func (*ListSimilarsResponse) Descriptor ¶
func (*ListSimilarsResponse) Descriptor() ([]byte, []int)
func (*ListSimilarsResponse) Equal ¶
func (this *ListSimilarsResponse) Equal(that interface{}) bool
func (*ListSimilarsResponse) GetNextPageToken ¶
func (m *ListSimilarsResponse) GetNextPageToken() string
func (*ListSimilarsResponse) GetProducts ¶
func (m *ListSimilarsResponse) GetProducts() []*Product
func (*ListSimilarsResponse) Marshal ¶
func (m *ListSimilarsResponse) Marshal() (dAtA []byte, err error)
func (*ListSimilarsResponse) MarshalTo ¶
func (m *ListSimilarsResponse) MarshalTo(dAtA []byte) (int, error)
func (*ListSimilarsResponse) ProtoMessage ¶
func (*ListSimilarsResponse) ProtoMessage()
func (*ListSimilarsResponse) Reset ¶
func (m *ListSimilarsResponse) Reset()
func (*ListSimilarsResponse) Size ¶
func (m *ListSimilarsResponse) Size() (n int)
func (*ListSimilarsResponse) String ¶
func (m *ListSimilarsResponse) String() string
func (*ListSimilarsResponse) Unmarshal ¶
func (m *ListSimilarsResponse) Unmarshal(dAtA []byte) error
func (*ListSimilarsResponse) Validate ¶
func (this *ListSimilarsResponse) Validate() error
func (*ListSimilarsResponse) XXX_DiscardUnknown ¶
func (m *ListSimilarsResponse) XXX_DiscardUnknown()
func (*ListSimilarsResponse) XXX_Marshal ¶
func (m *ListSimilarsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListSimilarsResponse) XXX_Merge ¶
func (m *ListSimilarsResponse) XXX_Merge(src proto.Message)
func (*ListSimilarsResponse) XXX_Size ¶
func (m *ListSimilarsResponse) XXX_Size() int
func (*ListSimilarsResponse) XXX_Unmarshal ¶
func (m *ListSimilarsResponse) XXX_Unmarshal(b []byte) error
type Product ¶
type Product struct { ID *types.Int64Value `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // string image = 3 [(validator.field) = {string_not_empty: true}]; DescriptionDetail *types.StringValue `protobuf:"bytes,4,opt,name=description_detail,json=descriptionDetail,proto3" json:"description_detail,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewPopulatedProduct ¶
func (*Product) Descriptor ¶
func (*Product) GetDescriptionDetail ¶
func (m *Product) GetDescriptionDetail() *types.StringValue
func (*Product) GetID ¶
func (m *Product) GetID() *types.Int64Value
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) XXX_DiscardUnknown ¶
func (m *Product) XXX_DiscardUnknown()
func (*Product) XXX_Marshal ¶
func (*Product) XXX_Unmarshal ¶
type ProductServiceClient ¶
type ProductServiceClient interface { ListSimilars(ctx context.Context, in *ListSimilarsRequest, opts ...grpc.CallOption) (*ListSimilarsResponse, error) ListLikes(ctx context.Context, in *ListLikesRequest, opts ...grpc.CallOption) (*ListLikesResponse, error) }
ProductServiceClient is the client API for ProductService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewProductServiceClient ¶
func NewProductServiceClient(cc *grpc.ClientConn) ProductServiceClient
type ProductServiceServer ¶
type ProductServiceServer interface { ListSimilars(context.Context, *ListSimilarsRequest) (*ListSimilarsResponse, error) ListLikes(context.Context, *ListLikesRequest) (*ListLikesResponse, error) }
ProductServiceServer is the server API for ProductService service.