product

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package product is a reverse proxy.

It translates gRPC into GraphQL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGQLObjectTypes

func RegisterGQLObjectTypes(mux *runtime.ServeMux)

func RegisterProductServiceFromEndpoint

func RegisterProductServiceFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

func RegisterProductServiceHandler

func RegisterProductServiceHandler(mux *runtime.ServeMux, conn *grpc.ClientConn) error

func RegisterProductServiceHandlerClient

func RegisterProductServiceHandlerClient(mux *runtime.ServeMux, client ProductServiceClient) error

func RegisterProductServiceServer

func RegisterProductServiceServer(s *grpc.Server, srv ProductServiceServer)

Types

type GetProductRequest

type GetProductRequest struct {
	Upc                  string   `protobuf:"bytes,1,opt,name=upc,proto3" json:"upc,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetProductRequest) Descriptor

func (*GetProductRequest) Descriptor() ([]byte, []int)

func (*GetProductRequest) GetUpc

func (m *GetProductRequest) GetUpc() string

func (*GetProductRequest) ProtoMessage

func (*GetProductRequest) ProtoMessage()

func (*GetProductRequest) Reset

func (m *GetProductRequest) Reset()

func (*GetProductRequest) String

func (m *GetProductRequest) String() string

func (*GetProductRequest) XXX_DiscardUnknown

func (m *GetProductRequest) XXX_DiscardUnknown()

func (*GetProductRequest) XXX_Marshal

func (m *GetProductRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetProductRequest) XXX_Merge

func (m *GetProductRequest) XXX_Merge(src proto.Message)

func (*GetProductRequest) XXX_Size

func (m *GetProductRequest) XXX_Size() int

func (*GetProductRequest) XXX_Unmarshal

func (m *GetProductRequest) XXX_Unmarshal(b []byte) error

type GetProductResponse

type GetProductResponse struct {
	Products             *Product `protobuf:"bytes,1,opt,name=products,proto3" json:"products,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetProductResponse) Descriptor

func (*GetProductResponse) Descriptor() ([]byte, []int)

func (*GetProductResponse) GetProducts

func (m *GetProductResponse) GetProducts() *Product

func (*GetProductResponse) ProtoMessage

func (*GetProductResponse) ProtoMessage()

func (*GetProductResponse) Reset

func (m *GetProductResponse) Reset()

func (*GetProductResponse) String

func (m *GetProductResponse) String() string

func (*GetProductResponse) XXX_DiscardUnknown

func (m *GetProductResponse) XXX_DiscardUnknown()

func (*GetProductResponse) XXX_Marshal

func (m *GetProductResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetProductResponse) XXX_Merge

func (m *GetProductResponse) XXX_Merge(src proto.Message)

func (*GetProductResponse) XXX_Size

func (m *GetProductResponse) XXX_Size() int

func (*GetProductResponse) XXX_Unmarshal

func (m *GetProductResponse) XXX_Unmarshal(b []byte) error

type Product

type Product struct {
	Upc                  string   `protobuf:"bytes,1,opt,name=upc,proto3" json:"upc,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Price                int32    `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Product) Descriptor

func (*Product) Descriptor() ([]byte, []int)

func (*Product) GetName

func (m *Product) GetName() string

func (*Product) GetPrice

func (m *Product) GetPrice() int32

func (*Product) GetUpc

func (m *Product) GetUpc() string

func (*Product) ProtoMessage

func (*Product) ProtoMessage()

func (*Product) Reset

func (m *Product) Reset()

func (*Product) String

func (m *Product) String() string

func (*Product) XXX_DiscardUnknown

func (m *Product) XXX_DiscardUnknown()

func (*Product) XXX_Marshal

func (m *Product) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Product) XXX_Merge

func (m *Product) XXX_Merge(src proto.Message)

func (*Product) XXX_Size

func (m *Product) XXX_Size() int

func (*Product) XXX_Unmarshal

func (m *Product) XXX_Unmarshal(b []byte) error

type ProductServiceClient

type ProductServiceClient interface {
	TopProducts(ctx context.Context, in *TopProductsRequest, opts ...grpc.CallOption) (*TopProductsResponse, error)
	GetProduct(ctx context.Context, in *GetProductRequest, opts ...grpc.CallOption) (*GetProductResponse, 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 {
	TopProducts(context.Context, *TopProductsRequest) (*TopProductsResponse, error)
	GetProduct(context.Context, *GetProductRequest) (*GetProductResponse, error)
}

ProductServiceServer is the server API for ProductService service.

type TopProductsRequest

type TopProductsRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TopProductsRequest) Descriptor

func (*TopProductsRequest) Descriptor() ([]byte, []int)

func (*TopProductsRequest) ProtoMessage

func (*TopProductsRequest) ProtoMessage()

func (*TopProductsRequest) Reset

func (m *TopProductsRequest) Reset()

func (*TopProductsRequest) String

func (m *TopProductsRequest) String() string

func (*TopProductsRequest) XXX_DiscardUnknown

func (m *TopProductsRequest) XXX_DiscardUnknown()

func (*TopProductsRequest) XXX_Marshal

func (m *TopProductsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TopProductsRequest) XXX_Merge

func (m *TopProductsRequest) XXX_Merge(src proto.Message)

func (*TopProductsRequest) XXX_Size

func (m *TopProductsRequest) XXX_Size() int

func (*TopProductsRequest) XXX_Unmarshal

func (m *TopProductsRequest) XXX_Unmarshal(b []byte) error

type TopProductsResponse

type TopProductsResponse struct {
	Products             []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*TopProductsResponse) Descriptor

func (*TopProductsResponse) Descriptor() ([]byte, []int)

func (*TopProductsResponse) GetProducts

func (m *TopProductsResponse) GetProducts() []*Product

func (*TopProductsResponse) ProtoMessage

func (*TopProductsResponse) ProtoMessage()

func (*TopProductsResponse) Reset

func (m *TopProductsResponse) Reset()

func (*TopProductsResponse) String

func (m *TopProductsResponse) String() string

func (*TopProductsResponse) XXX_DiscardUnknown

func (m *TopProductsResponse) XXX_DiscardUnknown()

func (*TopProductsResponse) XXX_Marshal

func (m *TopProductsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TopProductsResponse) XXX_Merge

func (m *TopProductsResponse) XXX_Merge(src proto.Message)

func (*TopProductsResponse) XXX_Size

func (m *TopProductsResponse) XXX_Size() int

func (*TopProductsResponse) XXX_Unmarshal

func (m *TopProductsResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL