order

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 15 Imported by: 1

Documentation

Overview

Package order is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterOrderServiceHandler

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

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

func RegisterOrderServiceHandlerClient

func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderServiceClient) error

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

func RegisterOrderServiceHandlerFromEndpoint

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

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

func RegisterOrderServiceHandlerServer

func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderServiceServer) error

RegisterOrderServiceHandlerServer registers the http handlers for service OrderService to "mux". UnaryRPC :call OrderServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterOrderServiceServer

func RegisterOrderServiceServer(s *grpc.Server, srv OrderServiceServer)

Types

type CreateOrderReq

type CreateOrderReq struct {
	Order                *Order   `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CreateOrderReq) Descriptor

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

func (*CreateOrderReq) GetOrder

func (m *CreateOrderReq) GetOrder() *Order

func (*CreateOrderReq) ProtoMessage

func (*CreateOrderReq) ProtoMessage()

func (*CreateOrderReq) Reset

func (m *CreateOrderReq) Reset()

func (*CreateOrderReq) String

func (m *CreateOrderReq) String() string

func (*CreateOrderReq) XXX_DiscardUnknown

func (m *CreateOrderReq) XXX_DiscardUnknown()

func (*CreateOrderReq) XXX_Marshal

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

func (*CreateOrderReq) XXX_Merge

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

func (*CreateOrderReq) XXX_Size

func (m *CreateOrderReq) XXX_Size() int

func (*CreateOrderReq) XXX_Unmarshal

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

type CreateOrderResp

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

func (*CreateOrderResp) Descriptor

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

func (*CreateOrderResp) GetId

func (m *CreateOrderResp) GetId() string

func (*CreateOrderResp) ProtoMessage

func (*CreateOrderResp) ProtoMessage()

func (*CreateOrderResp) Reset

func (m *CreateOrderResp) Reset()

func (*CreateOrderResp) String

func (m *CreateOrderResp) String() string

func (*CreateOrderResp) XXX_DiscardUnknown

func (m *CreateOrderResp) XXX_DiscardUnknown()

func (*CreateOrderResp) XXX_Marshal

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

func (*CreateOrderResp) XXX_Merge

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

func (*CreateOrderResp) XXX_Size

func (m *CreateOrderResp) XXX_Size() int

func (*CreateOrderResp) XXX_Unmarshal

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

type Order

type Order struct {
	Id                   string             `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string             `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Date                 int64              `protobuf:"varint,3,opt,name=date,proto3" json:"date,omitempty"`
	Products             []*product.Product `protobuf:"bytes,4,rep,name=products,proto3" json:"products,omitempty"`
	Ip                   string             `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*Order) Descriptor

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

func (*Order) GetDate

func (m *Order) GetDate() int64

func (*Order) GetId

func (m *Order) GetId() string

func (*Order) GetIp added in v1.0.2

func (m *Order) GetIp() string

func (*Order) GetName

func (m *Order) GetName() string

func (*Order) GetProducts

func (m *Order) GetProducts() []*product.Product

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) Reset

func (m *Order) Reset()

func (*Order) String

func (m *Order) String() string

func (*Order) XXX_DiscardUnknown

func (m *Order) XXX_DiscardUnknown()

func (*Order) XXX_Marshal

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

func (*Order) XXX_Merge

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

func (*Order) XXX_Size

func (m *Order) XXX_Size() int

func (*Order) XXX_Unmarshal

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

type OrderServiceClient

type OrderServiceClient interface {
	Create(ctx context.Context, in *CreateOrderReq, opts ...grpc.CallOption) (*CreateOrderResp, error)
	Read(ctx context.Context, in *ReadOrderReq, opts ...grpc.CallOption) (*ReadOrderResp, error)
}

OrderServiceClient is the client API for OrderService service.

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

type OrderServiceServer

type OrderServiceServer interface {
	Create(context.Context, *CreateOrderReq) (*CreateOrderResp, error)
	Read(context.Context, *ReadOrderReq) (*ReadOrderResp, error)
}

OrderServiceServer is the server API for OrderService service.

type ReadOrderReq

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

func (*ReadOrderReq) Descriptor

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

func (*ReadOrderReq) GetId

func (m *ReadOrderReq) GetId() string

func (*ReadOrderReq) ProtoMessage

func (*ReadOrderReq) ProtoMessage()

func (*ReadOrderReq) Reset

func (m *ReadOrderReq) Reset()

func (*ReadOrderReq) String

func (m *ReadOrderReq) String() string

func (*ReadOrderReq) XXX_DiscardUnknown

func (m *ReadOrderReq) XXX_DiscardUnknown()

func (*ReadOrderReq) XXX_Marshal

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

func (*ReadOrderReq) XXX_Merge

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

func (*ReadOrderReq) XXX_Size

func (m *ReadOrderReq) XXX_Size() int

func (*ReadOrderReq) XXX_Unmarshal

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

type ReadOrderResp

type ReadOrderResp struct {
	Order                *Order   `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ReadOrderResp) Descriptor

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

func (*ReadOrderResp) GetOrder

func (m *ReadOrderResp) GetOrder() *Order

func (*ReadOrderResp) ProtoMessage

func (*ReadOrderResp) ProtoMessage()

func (*ReadOrderResp) Reset

func (m *ReadOrderResp) Reset()

func (*ReadOrderResp) String

func (m *ReadOrderResp) String() string

func (*ReadOrderResp) XXX_DiscardUnknown

func (m *ReadOrderResp) XXX_DiscardUnknown()

func (*ReadOrderResp) XXX_Marshal

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

func (*ReadOrderResp) XXX_Merge

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

func (*ReadOrderResp) XXX_Size

func (m *ReadOrderResp) XXX_Size() int

func (*ReadOrderResp) XXX_Unmarshal

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

type UnimplementedOrderServiceServer

type UnimplementedOrderServiceServer struct {
}

UnimplementedOrderServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedOrderServiceServer) Create

func (*UnimplementedOrderServiceServer) Read

Jump to

Keyboard shortcuts

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