v1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProductService_GetProduct_FullMethodName    = "/product.v1.ProductService/GetProduct"
	ProductService_CreateProduct_FullMethodName = "/product.v1.ProductService/CreateProduct"
	ProductService_UpdateProduct_FullMethodName = "/product.v1.ProductService/UpdateProduct"
	ProductService_ListProducts_FullMethodName  = "/product.v1.ProductService/ListProducts"
)

Variables

View Source
var File_product_proto protoreflect.FileDescriptor
View Source
var ProductService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "product.v1.ProductService",
	HandlerType: (*ProductServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetProduct",
			Handler:    _ProductService_GetProduct_Handler,
		},
		{
			MethodName: "CreateProduct",
			Handler:    _ProductService_CreateProduct_Handler,
		},
		{
			MethodName: "UpdateProduct",
			Handler:    _ProductService_UpdateProduct_Handler,
		},
		{
			MethodName: "ListProducts",
			Handler:    _ProductService_ListProducts_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "product.proto",
}

ProductService_ServiceDesc is the grpc.ServiceDesc for ProductService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterProductServiceServer

func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)

Types

type CreateProductRequest

type CreateProductRequest struct {
	Name        string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description string  `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Price       float64 `protobuf:"fixed64,3,opt,name=price,proto3" json:"price,omitempty"`
	Inventory   int32   `protobuf:"varint,4,opt,name=inventory,proto3" json:"inventory,omitempty"`
	Category    string  `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"`
	// contains filtered or unexported fields
}

Request to create a new product.

func (*CreateProductRequest) Descriptor deprecated

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

Deprecated: Use CreateProductRequest.ProtoReflect.Descriptor instead.

func (*CreateProductRequest) GetCategory

func (x *CreateProductRequest) GetCategory() string

func (*CreateProductRequest) GetDescription

func (x *CreateProductRequest) GetDescription() string

func (*CreateProductRequest) GetInventory

func (x *CreateProductRequest) GetInventory() int32

func (*CreateProductRequest) GetName

func (x *CreateProductRequest) GetName() string

func (*CreateProductRequest) GetPrice

func (x *CreateProductRequest) GetPrice() float64

func (*CreateProductRequest) ProtoMessage

func (*CreateProductRequest) ProtoMessage()

func (*CreateProductRequest) ProtoReflect

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

func (*CreateProductRequest) Reset

func (x *CreateProductRequest) Reset()

func (*CreateProductRequest) String

func (x *CreateProductRequest) String() string

type CreateProductResponse

type CreateProductResponse struct {
	Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"`
	// contains filtered or unexported fields
}

Response for creating a product.

func (*CreateProductResponse) Descriptor deprecated

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

Deprecated: Use CreateProductResponse.ProtoReflect.Descriptor instead.

func (*CreateProductResponse) GetProduct

func (x *CreateProductResponse) GetProduct() *Product

func (*CreateProductResponse) ProtoMessage

func (*CreateProductResponse) ProtoMessage()

func (*CreateProductResponse) ProtoReflect

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

func (*CreateProductResponse) Reset

func (x *CreateProductResponse) Reset()

func (*CreateProductResponse) String

func (x *CreateProductResponse) String() string

type GetProductRequest

type GetProductRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Request to get a product by ID.

func (*GetProductRequest) Descriptor deprecated

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

Deprecated: Use GetProductRequest.ProtoReflect.Descriptor instead.

func (*GetProductRequest) GetId

func (x *GetProductRequest) GetId() string

func (*GetProductRequest) ProtoMessage

func (*GetProductRequest) ProtoMessage()

func (*GetProductRequest) ProtoReflect

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

func (*GetProductRequest) Reset

func (x *GetProductRequest) Reset()

func (*GetProductRequest) String

func (x *GetProductRequest) String() string

type GetProductResponse

type GetProductResponse struct {
	Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"`
	// contains filtered or unexported fields
}

Response for getting a product.

func (*GetProductResponse) Descriptor deprecated

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

Deprecated: Use GetProductResponse.ProtoReflect.Descriptor instead.

func (*GetProductResponse) GetProduct

func (x *GetProductResponse) GetProduct() *Product

func (*GetProductResponse) ProtoMessage

func (*GetProductResponse) ProtoMessage()

func (*GetProductResponse) ProtoReflect

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

func (*GetProductResponse) Reset

func (x *GetProductResponse) Reset()

func (*GetProductResponse) String

func (x *GetProductResponse) String() string

type ListProductsRequest

type ListProductsRequest struct {
	PageSize  int32  `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// contains filtered or unexported fields
}

Request to list products, with optional pagination.

func (*ListProductsRequest) Descriptor deprecated

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

Deprecated: Use ListProductsRequest.ProtoReflect.Descriptor instead.

func (*ListProductsRequest) GetPageSize

func (x *ListProductsRequest) GetPageSize() int32

func (*ListProductsRequest) GetPageToken

func (x *ListProductsRequest) GetPageToken() string

func (*ListProductsRequest) ProtoMessage

func (*ListProductsRequest) ProtoMessage()

func (*ListProductsRequest) ProtoReflect

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

func (*ListProductsRequest) Reset

func (x *ListProductsRequest) Reset()

func (*ListProductsRequest) String

func (x *ListProductsRequest) String() string

type ListProductsResponse

type ListProductsResponse 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"`
	// contains filtered or unexported fields
}

Response for listing products.

func (*ListProductsResponse) Descriptor deprecated

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

Deprecated: Use ListProductsResponse.ProtoReflect.Descriptor instead.

func (*ListProductsResponse) GetNextPageToken

func (x *ListProductsResponse) GetNextPageToken() string

func (*ListProductsResponse) GetProducts

func (x *ListProductsResponse) GetProducts() []*Product

func (*ListProductsResponse) ProtoMessage

func (*ListProductsResponse) ProtoMessage()

func (*ListProductsResponse) ProtoReflect

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

func (*ListProductsResponse) Reset

func (x *ListProductsResponse) Reset()

func (*ListProductsResponse) String

func (x *ListProductsResponse) String() string

type Product

type Product 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"`
	Description string  `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	Price       float64 `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"`
	Inventory   int32   `protobuf:"varint,5,opt,name=inventory,proto3" json:"inventory,omitempty"`
	Category    string  `protobuf:"bytes,6,opt,name=category,proto3" json:"category,omitempty"`
	CreatedAt   string  `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt   string  `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

The Product message represents an e-commerce product.

func (*Product) Descriptor deprecated

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

Deprecated: Use Product.ProtoReflect.Descriptor instead.

func (*Product) GetCategory

func (x *Product) GetCategory() string

func (*Product) GetCreatedAt

func (x *Product) GetCreatedAt() string

func (*Product) GetDescription

func (x *Product) GetDescription() string

func (*Product) GetId

func (x *Product) GetId() string

func (*Product) GetInventory

func (x *Product) GetInventory() int32

func (*Product) GetName

func (x *Product) GetName() string

func (*Product) GetPrice

func (x *Product) GetPrice() float64

func (*Product) GetUpdatedAt

func (x *Product) GetUpdatedAt() string

func (*Product) ProtoMessage

func (*Product) ProtoMessage()

func (*Product) ProtoReflect

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

func (*Product) Reset

func (x *Product) Reset()

func (*Product) String

func (x *Product) String() string

type ProductServiceClient

type ProductServiceClient interface {
	GetProduct(ctx context.Context, in *GetProductRequest, opts ...grpc.CallOption) (*GetProductResponse, error)
	CreateProduct(ctx context.Context, in *CreateProductRequest, opts ...grpc.CallOption) (*CreateProductResponse, error)
	UpdateProduct(ctx context.Context, in *UpdateProductRequest, opts ...grpc.CallOption) (*UpdateProductResponse, error)
	ListProducts(ctx context.Context, in *ListProductsRequest, opts ...grpc.CallOption) (*ListProductsResponse, error)
}

ProductServiceClient is the client API for ProductService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

ProductService provides product management operations.

type ProductServiceServer

type ProductServiceServer interface {
	GetProduct(context.Context, *GetProductRequest) (*GetProductResponse, error)
	CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error)
	UpdateProduct(context.Context, *UpdateProductRequest) (*UpdateProductResponse, error)
	ListProducts(context.Context, *ListProductsRequest) (*ListProductsResponse, error)
	// contains filtered or unexported methods
}

ProductServiceServer is the server API for ProductService service. All implementations must embed UnimplementedProductServiceServer for forward compatibility.

ProductService provides product management operations.

type UnimplementedProductServiceServer

type UnimplementedProductServiceServer struct{}

UnimplementedProductServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedProductServiceServer) CreateProduct

func (UnimplementedProductServiceServer) GetProduct

func (UnimplementedProductServiceServer) ListProducts

func (UnimplementedProductServiceServer) UpdateProduct

type UnsafeProductServiceServer

type UnsafeProductServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeProductServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProductServiceServer will result in compilation errors.

type UpdateProductRequest

type UpdateProductRequest 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"`
	Description string  `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	Price       float64 `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"`
	Inventory   int32   `protobuf:"varint,5,opt,name=inventory,proto3" json:"inventory,omitempty"`
	Category    string  `protobuf:"bytes,6,opt,name=category,proto3" json:"category,omitempty"`
	// contains filtered or unexported fields
}

Request to update an existing product.

func (*UpdateProductRequest) Descriptor deprecated

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

Deprecated: Use UpdateProductRequest.ProtoReflect.Descriptor instead.

func (*UpdateProductRequest) GetCategory

func (x *UpdateProductRequest) GetCategory() string

func (*UpdateProductRequest) GetDescription

func (x *UpdateProductRequest) GetDescription() string

func (*UpdateProductRequest) GetId

func (x *UpdateProductRequest) GetId() string

func (*UpdateProductRequest) GetInventory

func (x *UpdateProductRequest) GetInventory() int32

func (*UpdateProductRequest) GetName

func (x *UpdateProductRequest) GetName() string

func (*UpdateProductRequest) GetPrice

func (x *UpdateProductRequest) GetPrice() float64

func (*UpdateProductRequest) ProtoMessage

func (*UpdateProductRequest) ProtoMessage()

func (*UpdateProductRequest) ProtoReflect

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

func (*UpdateProductRequest) Reset

func (x *UpdateProductRequest) Reset()

func (*UpdateProductRequest) String

func (x *UpdateProductRequest) String() string

type UpdateProductResponse

type UpdateProductResponse struct {
	Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"`
	// contains filtered or unexported fields
}

Response for updating a product.

func (*UpdateProductResponse) Descriptor deprecated

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

Deprecated: Use UpdateProductResponse.ProtoReflect.Descriptor instead.

func (*UpdateProductResponse) GetProduct

func (x *UpdateProductResponse) GetProduct() *Product

func (*UpdateProductResponse) ProtoMessage

func (*UpdateProductResponse) ProtoMessage()

func (*UpdateProductResponse) ProtoReflect

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

func (*UpdateProductResponse) Reset

func (x *UpdateProductResponse) Reset()

func (*UpdateProductResponse) String

func (x *UpdateProductResponse) String() string

Directories

Path Synopsis
product
v1

Jump to

Keyboard shortcuts

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