v1

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterWebScraperHandler

func RegisterWebScraperHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterWebScraperHandler registers the http handlers for service WebScraper to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterWebScraperHandlerClient

func RegisterWebScraperHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WebScraperClient) error

RegisterWebScraperHandlerClient registers the http handlers for service WebScraper to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WebScraperClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WebScraperClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WebScraperClient" to call the correct interceptors.

func RegisterWebScraperHandlerFromEndpoint

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

RegisterWebScraperHandlerFromEndpoint is same as RegisterWebScraperHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterWebScraperServer

func RegisterWebScraperServer(s *grpc.Server, srv WebScraperServer)

Types

type GetProductRequest

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

Expected Request For GetProduct

func (*GetProductRequest) Descriptor

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

func (*GetProductRequest) GetAsin

func (m *GetProductRequest) GetAsin() 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 {
	Product              *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Expected Response From GetProduct

func (*GetProductResponse) Descriptor

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

func (*GetProductResponse) GetProduct

func (m *GetProductResponse) GetProduct() *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 {
	Asin                 string               `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"`
	Name                 string               `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Categories           []*ProductCategory   `protobuf:"bytes,3,rep,name=categories,proto3" json:"categories,omitempty"`
	Ranks                []*ProductRank       `protobuf:"bytes,4,rep,name=ranks,proto3" json:"ranks,omitempty"`
	Dimensions           []string             `protobuf:"bytes,5,rep,name=dimensions,proto3" json:"dimensions,omitempty"`
	CreatedAt            *timestamp.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

Project Object

func (*Product) Descriptor

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

func (*Product) GetAsin

func (m *Product) GetAsin() string

func (*Product) GetCategories

func (m *Product) GetCategories() []*ProductCategory

func (*Product) GetCreatedAt

func (m *Product) GetCreatedAt() *timestamp.Timestamp

func (*Product) GetDimensions

func (m *Product) GetDimensions() []string

func (*Product) GetName

func (m *Product) GetName() string

func (*Product) GetRanks

func (m *Product) GetRanks() []*ProductRank

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 ProductCategory

type ProductCategory struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Level                int64    `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ProjectCategoryObject

func (*ProductCategory) Descriptor

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

func (*ProductCategory) GetLevel

func (m *ProductCategory) GetLevel() int64

func (*ProductCategory) GetName

func (m *ProductCategory) GetName() string

func (*ProductCategory) ProtoMessage

func (*ProductCategory) ProtoMessage()

func (*ProductCategory) Reset

func (m *ProductCategory) Reset()

func (*ProductCategory) String

func (m *ProductCategory) String() string

func (*ProductCategory) XXX_DiscardUnknown

func (m *ProductCategory) XXX_DiscardUnknown()

func (*ProductCategory) XXX_Marshal

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

func (*ProductCategory) XXX_Merge

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

func (*ProductCategory) XXX_Size

func (m *ProductCategory) XXX_Size() int

func (*ProductCategory) XXX_Unmarshal

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

type ProductRank

type ProductRank struct {
	RankInfo             string   `protobuf:"bytes,1,opt,name=rank_info,json=rankInfo,proto3" json:"rank_info,omitempty"`
	Level                int64    `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ProjectRankObject

func (*ProductRank) Descriptor

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

func (*ProductRank) GetLevel

func (m *ProductRank) GetLevel() int64

func (*ProductRank) GetRankInfo

func (m *ProductRank) GetRankInfo() string

func (*ProductRank) ProtoMessage

func (*ProductRank) ProtoMessage()

func (*ProductRank) Reset

func (m *ProductRank) Reset()

func (*ProductRank) String

func (m *ProductRank) String() string

func (*ProductRank) XXX_DiscardUnknown

func (m *ProductRank) XXX_DiscardUnknown()

func (*ProductRank) XXX_Marshal

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

func (*ProductRank) XXX_Merge

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

func (*ProductRank) XXX_Size

func (m *ProductRank) XXX_Size() int

func (*ProductRank) XXX_Unmarshal

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

type WebScraperClient

type WebScraperClient interface {
	//This end point takes Amazon Product ASIN, and returns name, categories, ranks and dimensions
	GetProduct(ctx context.Context, in *GetProductRequest, opts ...grpc.CallOption) (*GetProductResponse, error)
}

WebScraperClient is the client API for WebScraper service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewWebScraperClient

func NewWebScraperClient(cc *grpc.ClientConn) WebScraperClient

type WebScraperServer

type WebScraperServer interface {
	//This end point takes Amazon Product ASIN, and returns name, categories, ranks and dimensions
	GetProduct(context.Context, *GetProductRequest) (*GetProductResponse, error)
}

WebScraperServer is the server API for WebScraper service.

Jump to

Keyboard shortcuts

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