api

package
v0.0.0-...-64808f0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-triple. DO NOT EDIT.

Source: detail_api.proto

Index

Constants

View Source
const (
	// DetailGetItemProcedure is the fully-qualified name of the Detail's GetItem RPC.
	DetailGetItemProcedure = "/org.apache.dubbogo.samples.shop.detail.api.Detail/GetItem"
	// DetailDeductStockProcedure is the fully-qualified name of the Detail's DeductStock RPC.
	DetailDeductStockProcedure = "/org.apache.dubbogo.samples.shop.detail.api.Detail/DeductStock"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// DetailName is the fully-qualified name of the Detail service.
	DetailName = "org.apache.dubbogo.samples.shop.detail.api.Detail"
)

Variables

View Source
var Detail_ClientInfo = client.ClientInfo{
	InterfaceName: "org.apache.dubbogo.samples.shop.detail.api.Detail",
	MethodNames:   []string{"GetItem", "DeductStock"},
	ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) {
		dubboCli := dubboCliRaw.(*DetailImpl)
		dubboCli.conn = conn
	},
}
View Source
var Detail_ServiceInfo = server.ServiceInfo{
	InterfaceName: "org.apache.dubbogo.samples.shop.detail.api.Detail",
	ServiceType:   (*DetailHandler)(nil),
	Methods: []server.MethodInfo{
		{
			Name: "GetItem",
			Type: constant.CallUnary,
			ReqInitFunc: func() interface{} {
				return new(GetItemReq)
			},
			MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
				req := args[0].(*GetItemReq)
				res, err := handler.(DetailHandler).GetItem(ctx, req)
				if err != nil {
					return nil, err
				}
				return triple_protocol.NewResponse(res), nil
			},
		},
		{
			Name: "DeductStock",
			Type: constant.CallUnary,
			ReqInitFunc: func() interface{} {
				return new(DeductStockReq)
			},
			MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
				req := args[0].(*DeductStockReq)
				res, err := handler.(DetailHandler).DeductStock(ctx, req)
				if err != nil {
					return nil, err
				}
				return triple_protocol.NewResponse(res), nil
			},
		},
	},
}
View Source
var File_detail_api_proto protoreflect.FileDescriptor

Functions

func RegisterDetailHandler

func RegisterDetailHandler(srv *server.Server, hdlr DetailHandler, opts ...server.ServiceOption) error

func SetConsumerService

func SetConsumerService(srv common.RPCService)

func SetProviderService

func SetProviderService(srv common.RPCService)

Types

type DeductStockReq

type DeductStockReq struct {
	Sku   int64 `protobuf:"varint,1,opt,name=Sku,proto3" json:"Sku,omitempty"`
	Count int32 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"`
	// contains filtered or unexported fields
}

func (*DeductStockReq) Descriptor deprecated

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

Deprecated: Use DeductStockReq.ProtoReflect.Descriptor instead.

func (*DeductStockReq) GetCount

func (x *DeductStockReq) GetCount() int32

func (*DeductStockReq) GetSku

func (x *DeductStockReq) GetSku() int64

func (*DeductStockReq) ProtoMessage

func (*DeductStockReq) ProtoMessage()

func (*DeductStockReq) ProtoReflect

func (x *DeductStockReq) ProtoReflect() protoreflect.Message

func (*DeductStockReq) Reset

func (x *DeductStockReq) Reset()

func (*DeductStockReq) String

func (x *DeductStockReq) String() string

type DeductStockResp

type DeductStockResp struct {
	Success bool `protobuf:"varint,1,opt,name=Success,proto3" json:"Success,omitempty"`
	// contains filtered or unexported fields
}

func (*DeductStockResp) Descriptor deprecated

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

Deprecated: Use DeductStockResp.ProtoReflect.Descriptor instead.

func (*DeductStockResp) GetSuccess

func (x *DeductStockResp) GetSuccess() bool

func (*DeductStockResp) ProtoMessage

func (*DeductStockResp) ProtoMessage()

func (*DeductStockResp) ProtoReflect

func (x *DeductStockResp) ProtoReflect() protoreflect.Message

func (*DeductStockResp) Reset

func (x *DeductStockResp) Reset()

func (*DeductStockResp) String

func (x *DeductStockResp) String() string

type Detail

type Detail interface {
	GetItem(ctx context.Context, req *GetItemReq, opts ...client.CallOption) (*Item, error)
	DeductStock(ctx context.Context, req *DeductStockReq, opts ...client.CallOption) (*DeductStockResp, error)
}

Detail is a client for the org.apache.dubbogo.samples.shop.detail.api.Detail service.

func NewDetail

func NewDetail(cli *client.Client, opts ...client.ReferenceOption) (Detail, error)

NewDetail constructs a client for the api.Detail service.

type DetailHandler

type DetailHandler interface {
	GetItem(context.Context, *GetItemReq) (*Item, error)
	DeductStock(context.Context, *DeductStockReq) (*DeductStockResp, error)
}

DetailHandler is an implementation of the org.apache.dubbogo.samples.shop.detail.api.Detail service.

type DetailImpl

type DetailImpl struct {
	// contains filtered or unexported fields
}

DetailImpl implements Detail.

func (*DetailImpl) DeductStock

func (c *DetailImpl) DeductStock(ctx context.Context, req *DeductStockReq, opts ...client.CallOption) (*DeductStockResp, error)

func (*DetailImpl) GetItem

func (c *DetailImpl) GetItem(ctx context.Context, req *GetItemReq, opts ...client.CallOption) (*Item, error)

type GetItemReq

type GetItemReq struct {
	Sku      int64  `protobuf:"varint,1,opt,name=Sku,proto3" json:"Sku,omitempty"`
	UserName string `protobuf:"bytes,2,opt,name=UserName,proto3" json:"UserName,omitempty"`
	// contains filtered or unexported fields
}

func (*GetItemReq) Descriptor deprecated

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

Deprecated: Use GetItemReq.ProtoReflect.Descriptor instead.

func (*GetItemReq) GetSku

func (x *GetItemReq) GetSku() int64

func (*GetItemReq) GetUserName

func (x *GetItemReq) GetUserName() string

func (*GetItemReq) ProtoMessage

func (*GetItemReq) ProtoMessage()

func (*GetItemReq) ProtoReflect

func (x *GetItemReq) ProtoReflect() protoreflect.Message

func (*GetItemReq) Reset

func (x *GetItemReq) Reset()

func (*GetItemReq) String

func (x *GetItemReq) String() string

type Item

type Item struct {
	Sku         int64  `protobuf:"varint,1,opt,name=Sku,proto3" json:"Sku,omitempty"`
	ItemName    string `protobuf:"bytes,2,opt,name=ItemName,proto3" json:"ItemName,omitempty"`
	Description string `protobuf:"bytes,3,opt,name=Description,proto3" json:"Description,omitempty"`
	Stock       int32  `protobuf:"varint,4,opt,name=Stock,proto3" json:"Stock,omitempty"`
	Price       int64  `protobuf:"varint,5,opt,name=Price,proto3" json:"Price,omitempty"`
	Comment     string `protobuf:"bytes,6,opt,name=Comment,proto3" json:"Comment,omitempty"`
	// contains filtered or unexported fields
}

func (*Item) Descriptor deprecated

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

Deprecated: Use Item.ProtoReflect.Descriptor instead.

func (*Item) GetComment

func (x *Item) GetComment() string

func (*Item) GetDescription

func (x *Item) GetDescription() string

func (*Item) GetItemName

func (x *Item) GetItemName() string

func (*Item) GetPrice

func (x *Item) GetPrice() int64

func (*Item) GetSku

func (x *Item) GetSku() int64

func (*Item) GetStock

func (x *Item) GetStock() int32

func (*Item) ProtoMessage

func (*Item) ProtoMessage()

func (*Item) ProtoReflect

func (x *Item) ProtoReflect() protoreflect.Message

func (*Item) Reset

func (x *Item) Reset()

func (*Item) String

func (x *Item) String() string

Jump to

Keyboard shortcuts

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