Documentation
¶
Overview ¶
Package product is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v7.0.0.
It is generated from these files:
catalog-go/product/attribute.proto catalog-go/product/category.proto catalog-go/product/image.proto catalog-go/product/label.proto catalog-go/product/product.proto
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type Attribute
- func (*Attribute) Descriptor() ([]byte, []int)deprecated
- func (x *Attribute) GetId() int32
- func (x *Attribute) GetType() string
- func (x *Attribute) GetTypeId() int32
- func (x *Attribute) GetValueId() int32
- func (*Attribute) ProtoMessage()
- func (x *Attribute) ProtoReflect() protoreflect.Message
- func (x *Attribute) Reset()
- func (x *Attribute) String() string
- type Category
- func (*Category) Descriptor() ([]byte, []int)deprecated
- func (x *Category) GetCategoryId() int32
- func (x *Category) GetId() int32
- func (x *Category) GetTitle() string
- func (*Category) ProtoMessage()
- func (x *Category) ProtoReflect() protoreflect.Message
- func (x *Category) Reset()
- func (x *Category) String() string
- type Gender
- type HTTPClient
- type IdentifiedProductResponse
- func (*IdentifiedProductResponse) Descriptor() ([]byte, []int)deprecated
- func (x *IdentifiedProductResponse) GetIdentifiedBy() Identifier
- func (x *IdentifiedProductResponse) GetProducts() []*ProductListItem
- func (*IdentifiedProductResponse) ProtoMessage()
- func (x *IdentifiedProductResponse) ProtoReflect() protoreflect.Message
- func (x *IdentifiedProductResponse) Reset()
- func (x *IdentifiedProductResponse) String() string
- type Identifier
- type IdentifyProductRequest
- func (*IdentifyProductRequest) Descriptor() ([]byte, []int)deprecated
- func (x *IdentifyProductRequest) GetGtin() string
- func (x *IdentifyProductRequest) GetMpn() string
- func (x *IdentifyProductRequest) GetRemoteId() string
- func (*IdentifyProductRequest) ProtoMessage()
- func (x *IdentifyProductRequest) ProtoReflect() protoreflect.Message
- func (x *IdentifyProductRequest) Reset()
- func (x *IdentifyProductRequest) String() string
- type Image
- func (*Image) Descriptor() ([]byte, []int)deprecated
- func (x *Image) GetAlt() string
- func (x *Image) GetId() int32
- func (x *Image) GetMain() bool
- func (x *Image) GetSource() string
- func (*Image) ProtoMessage()
- func (x *Image) ProtoReflect() protoreflect.Message
- func (x *Image) Reset()
- func (x *Image) String() string
- type Label
- func (*Label) Descriptor() ([]byte, []int)deprecated
- func (x *Label) GetActive() bool
- func (x *Label) GetId() int32
- func (x *Label) GetName() string
- func (x *Label) GetTitle() string
- func (*Label) ProtoMessage()
- func (x *Label) ProtoReflect() protoreflect.Message
- func (x *Label) Reset()
- func (x *Label) String() string
- type Product
- func (*Product) Descriptor() ([]byte, []int)deprecated
- func (x *Product) GetActive() bool
- func (x *Product) GetActiveSince() *timestamp.Timestamp
- func (x *Product) GetAttributes() []*Attribute
- func (x *Product) GetBrandId() int32
- func (x *Product) GetCategories() []*Category
- func (x *Product) GetCode() string
- func (x *Product) GetCreatedAt() *timestamp.Timestamp
- func (x *Product) GetDescription() string
- func (x *Product) GetGender() Gender
- func (x *Product) GetGtin() string
- func (x *Product) GetId() int32
- func (x *Product) GetImages() []*Image
- func (x *Product) GetLabels() []*Label
- func (x *Product) GetMainProductId() int32
- func (x *Product) GetManualPairingCode() string
- func (x *Product) GetMetaDescription() string
- func (x *Product) GetMetaKeywords() string
- func (x *Product) GetMetaTitle() string
- func (x *Product) GetModelId() int32
- func (x *Product) GetMpn() string
- func (x *Product) GetRecommendedPrice() float64
- func (x *Product) GetReleasedDate() *timestamp.Timestamp
- func (x *Product) GetRemoteId() string
- func (x *Product) GetSizeTableId() int32
- func (x *Product) GetSlug() string
- func (x *Product) GetSource() string
- func (x *Product) GetStage() Stage
- func (x *Product) GetTitle() string
- func (x *Product) GetUpdatedAt() *timestamp.Timestamp
- func (*Product) ProtoMessage()
- func (x *Product) ProtoReflect() protoreflect.Message
- func (x *Product) Reset()
- func (x *Product) String() string
- type ProductListItem
- func (*ProductListItem) Descriptor() ([]byte, []int)deprecated
- func (x *ProductListItem) GetActive() bool
- func (x *ProductListItem) GetBrandId() int32
- func (x *ProductListItem) GetCode() string
- func (x *ProductListItem) GetCreatedAt() *timestamp.Timestamp
- func (x *ProductListItem) GetDescription() string
- func (x *ProductListItem) GetGender() Gender
- func (x *ProductListItem) GetGtin() string
- func (x *ProductListItem) GetId() int32
- func (x *ProductListItem) GetMainProductId() int32
- func (x *ProductListItem) GetManualPairingCode() string
- func (x *ProductListItem) GetModelId() int32
- func (x *ProductListItem) GetMpn() string
- func (x *ProductListItem) GetReleasedDate() *timestamp.Timestamp
- func (x *ProductListItem) GetRemoteId() string
- func (x *ProductListItem) GetSizeTableId() int32
- func (x *ProductListItem) GetSlug() string
- func (x *ProductListItem) GetStage() Stage
- func (x *ProductListItem) GetTitle() string
- func (x *ProductListItem) GetUpdatedAt() *timestamp.Timestamp
- func (*ProductListItem) ProtoMessage()
- func (x *ProductListItem) ProtoReflect() protoreflect.Message
- func (x *ProductListItem) Reset()
- func (x *ProductListItem) String() string
- type ProductRequest
- type ProductService
- type Stage
- type TwirpServer
Constants ¶
const ProductServicePathPrefix = "/twirp/flexdog.catalog.product.ProductService/"
ProductServicePathPrefix is a convenience constant that could used to identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, that add a "/twirp" prefix by default, and use CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html
Variables ¶
var ( Gender_name = map[int32]string{ 0: "UNKNOWN", 1: "MALE", 2: "FEMALE", 3: "UNISEX", 4: "KIDS", } Gender_value = map[string]int32{ "UNKNOWN": 0, "MALE": 1, "FEMALE": 2, "UNISEX": 3, "KIDS": 4, } )
Enum value maps for Gender.
var ( Stage_name = map[int32]string{ 0: "DRAFT", 1: "VALIDATION", 2: "PUBLIC", 3: "REJECTED", 4: "DATA_SOURCE", } Stage_value = map[string]int32{ "DRAFT": 0, "VALIDATION": 1, "PUBLIC": 2, "REJECTED": 3, "DATA_SOURCE": 4, } )
Enum value maps for Stage.
var ( Identifier_name = map[int32]string{ 0: "REMOTE_ID", 1: "MPN", 2: "GTIN", } Identifier_value = map[string]int32{ "REMOTE_ID": 0, "MPN": 1, "GTIN": 2, } )
Enum value maps for Identifier.
var File_catalog_go_product_attribute_proto protoreflect.FileDescriptor
var File_catalog_go_product_category_proto protoreflect.FileDescriptor
var File_catalog_go_product_image_proto protoreflect.FileDescriptor
var File_catalog_go_product_label_proto protoreflect.FileDescriptor
var File_catalog_go_product_product_proto protoreflect.FileDescriptor
Functions ¶
func WriteError ¶
func WriteError(resp http.ResponseWriter, err error)
WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
Types ¶
type Attribute ¶
type Attribute struct { Id *int32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` TypeId int32 `protobuf:"varint,2,opt,name=type_id,json=typeId,proto3" json:"type_id,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` ValueId int32 `protobuf:"varint,4,opt,name=value_id,json=valueId,proto3" json:"value_id,omitempty"` // contains filtered or unexported fields }
func (*Attribute) Descriptor
deprecated
func (*Attribute) GetValueId ¶
func (*Attribute) ProtoMessage ¶
func (*Attribute) ProtoMessage()
func (*Attribute) ProtoReflect ¶
func (x *Attribute) ProtoReflect() protoreflect.Message
type Category ¶
type Category struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` CategoryId int32 `protobuf:"varint,2,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // contains filtered or unexported fields }
func (*Category) Descriptor
deprecated
func (*Category) GetCategoryId ¶
func (*Category) ProtoMessage ¶
func (*Category) ProtoMessage()
func (*Category) ProtoReflect ¶
func (x *Category) ProtoReflect() protoreflect.Message
type Gender ¶
type Gender int32
func (Gender) Descriptor ¶
func (Gender) Descriptor() protoreflect.EnumDescriptor
func (Gender) EnumDescriptor
deprecated
func (Gender) Number ¶
func (x Gender) Number() protoreflect.EnumNumber
func (Gender) Type ¶
func (Gender) Type() protoreflect.EnumType
type HTTPClient ¶
HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.
HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.
type IdentifiedProductResponse ¶
type IdentifiedProductResponse struct { IdentifiedBy Identifier `` /* 138-byte string literal not displayed */ Products []*ProductListItem `protobuf:"bytes,2,rep,name=products,proto3" json:"products,omitempty"` // contains filtered or unexported fields }
func (*IdentifiedProductResponse) Descriptor
deprecated
func (*IdentifiedProductResponse) Descriptor() ([]byte, []int)
Deprecated: Use IdentifiedProductResponse.ProtoReflect.Descriptor instead.
func (*IdentifiedProductResponse) GetIdentifiedBy ¶
func (x *IdentifiedProductResponse) GetIdentifiedBy() Identifier
func (*IdentifiedProductResponse) GetProducts ¶
func (x *IdentifiedProductResponse) GetProducts() []*ProductListItem
func (*IdentifiedProductResponse) ProtoMessage ¶
func (*IdentifiedProductResponse) ProtoMessage()
func (*IdentifiedProductResponse) ProtoReflect ¶
func (x *IdentifiedProductResponse) ProtoReflect() protoreflect.Message
func (*IdentifiedProductResponse) Reset ¶
func (x *IdentifiedProductResponse) Reset()
func (*IdentifiedProductResponse) String ¶
func (x *IdentifiedProductResponse) String() string
type Identifier ¶
type Identifier int32
const ( Identifier_REMOTE_ID Identifier = 0 Identifier_MPN Identifier = 1 Identifier_GTIN Identifier = 2 )
func (Identifier) Descriptor ¶
func (Identifier) Descriptor() protoreflect.EnumDescriptor
func (Identifier) Enum ¶
func (x Identifier) Enum() *Identifier
func (Identifier) EnumDescriptor
deprecated
func (Identifier) EnumDescriptor() ([]byte, []int)
Deprecated: Use Identifier.Descriptor instead.
func (Identifier) Number ¶
func (x Identifier) Number() protoreflect.EnumNumber
func (Identifier) String ¶
func (x Identifier) String() string
func (Identifier) Type ¶
func (Identifier) Type() protoreflect.EnumType
type IdentifyProductRequest ¶
type IdentifyProductRequest struct { RemoteId string `protobuf:"bytes,1,opt,name=remote_id,json=remoteId,proto3" json:"remote_id,omitempty"` Mpn string `protobuf:"bytes,2,opt,name=mpn,proto3" json:"mpn,omitempty"` Gtin string `protobuf:"bytes,3,opt,name=gtin,proto3" json:"gtin,omitempty"` // contains filtered or unexported fields }
func (*IdentifyProductRequest) Descriptor
deprecated
func (*IdentifyProductRequest) Descriptor() ([]byte, []int)
Deprecated: Use IdentifyProductRequest.ProtoReflect.Descriptor instead.
func (*IdentifyProductRequest) GetGtin ¶
func (x *IdentifyProductRequest) GetGtin() string
func (*IdentifyProductRequest) GetMpn ¶
func (x *IdentifyProductRequest) GetMpn() string
func (*IdentifyProductRequest) GetRemoteId ¶
func (x *IdentifyProductRequest) GetRemoteId() string
func (*IdentifyProductRequest) ProtoMessage ¶
func (*IdentifyProductRequest) ProtoMessage()
func (*IdentifyProductRequest) ProtoReflect ¶
func (x *IdentifyProductRequest) ProtoReflect() protoreflect.Message
func (*IdentifyProductRequest) Reset ¶
func (x *IdentifyProductRequest) Reset()
func (*IdentifyProductRequest) String ¶
func (x *IdentifyProductRequest) String() string
type Image ¶
type Image struct { Id *int32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` Alt string `protobuf:"bytes,3,opt,name=alt,proto3" json:"alt,omitempty"` Main bool `protobuf:"varint,4,opt,name=main,proto3" json:"main,omitempty"` // contains filtered or unexported fields }
func (*Image) Descriptor
deprecated
func (*Image) ProtoMessage ¶
func (*Image) ProtoMessage()
func (*Image) ProtoReflect ¶
func (x *Image) ProtoReflect() protoreflect.Message
type Label ¶
type Label struct { Id *int32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Active bool `protobuf:"varint,4,opt,name=active,proto3" json:"active,omitempty"` // contains filtered or unexported fields }
func (*Label) Descriptor
deprecated
func (*Label) ProtoMessage ¶
func (*Label) ProtoMessage()
func (*Label) ProtoReflect ¶
func (x *Label) ProtoReflect() protoreflect.Message
type Product ¶
type Product struct { Id *int32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` MetaTitle string `protobuf:"bytes,4,opt,name=meta_title,json=metaTitle,proto3" json:"meta_title,omitempty"` MetaDescription string `protobuf:"bytes,5,opt,name=meta_description,json=metaDescription,proto3" json:"meta_description,omitempty"` MetaKeywords string `protobuf:"bytes,6,opt,name=meta_keywords,json=metaKeywords,proto3" json:"meta_keywords,omitempty"` Slug string `protobuf:"bytes,31,opt,name=slug,proto3" json:"slug,omitempty"` Code string `protobuf:"bytes,7,opt,name=code,proto3" json:"code,omitempty"` ManualPairingCode string `protobuf:"bytes,8,opt,name=manual_pairing_code,json=manualPairingCode,proto3" json:"manual_pairing_code,omitempty"` ReleasedDate *timestamp.Timestamp `protobuf:"bytes,9,opt,name=released_date,json=releasedDate,proto3" json:"released_date,omitempty"` Stage Stage `protobuf:"varint,10,opt,name=stage,proto3,enum=flexdog.catalog.product.Stage" json:"stage,omitempty"` Source string `protobuf:"bytes,11,opt,name=source,proto3" json:"source,omitempty"` Gender Gender `protobuf:"varint,12,opt,name=gender,proto3,enum=flexdog.catalog.product.Gender" json:"gender,omitempty"` Mpn string `protobuf:"bytes,13,opt,name=mpn,proto3" json:"mpn,omitempty"` Gtin string `protobuf:"bytes,14,opt,name=gtin,proto3" json:"gtin,omitempty"` MainProductId *int32 `protobuf:"varint,15,opt,name=main_product_id,json=mainProductId,proto3,oneof" json:"main_product_id,omitempty"` RemoteId string `protobuf:"bytes,16,opt,name=remote_id,json=remoteId,proto3" json:"remote_id,omitempty"` RecommendedPrice float64 `protobuf:"fixed64,17,opt,name=recommended_price,json=recommendedPrice,proto3" json:"recommended_price,omitempty"` // referrals BrandId int32 `protobuf:"varint,18,opt,name=brand_id,json=brandId,proto3" json:"brand_id,omitempty"` ModelId int32 `protobuf:"varint,19,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"` SizeTableId *int32 `protobuf:"varint,20,opt,name=size_table_id,json=sizeTableId,proto3,oneof" json:"size_table_id,omitempty"` Attributes []*Attribute `protobuf:"bytes,23,rep,name=attributes,proto3" json:"attributes,omitempty"` Categories []*Category `protobuf:"bytes,24,rep,name=categories,proto3" json:"categories,omitempty"` Images []*Image `protobuf:"bytes,25,rep,name=images,proto3" json:"images,omitempty"` Labels []*Label `protobuf:"bytes,30,rep,name=labels,proto3" json:"labels,omitempty"` Active bool `protobuf:"varint,26,opt,name=active,proto3" json:"active,omitempty"` ActiveSince *timestamp.Timestamp `protobuf:"bytes,27,opt,name=active_since,json=activeSince,proto3" json:"active_since,omitempty"` // metadata CreatedAt *timestamp.Timestamp `protobuf:"bytes,28,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,29,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*Product) Descriptor
deprecated
func (*Product) GetActiveSince ¶
func (*Product) GetAttributes ¶
func (*Product) GetBrandId ¶
func (*Product) GetCategories ¶
func (*Product) GetCreatedAt ¶
func (*Product) GetDescription ¶
func (*Product) GetMainProductId ¶
func (*Product) GetManualPairingCode ¶
func (*Product) GetMetaDescription ¶
func (*Product) GetMetaKeywords ¶
func (*Product) GetMetaTitle ¶
func (*Product) GetModelId ¶
func (*Product) GetRecommendedPrice ¶
func (*Product) GetReleasedDate ¶
func (*Product) GetRemoteId ¶
func (*Product) GetSizeTableId ¶
func (*Product) GetUpdatedAt ¶
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) ProtoReflect ¶
func (x *Product) ProtoReflect() protoreflect.Message
type ProductListItem ¶
type ProductListItem struct { Id *int32 `protobuf:"varint,1,opt,name=Id,proto3,oneof" json:"Id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` Slug string `protobuf:"bytes,18,opt,name=slug,proto3" json:"slug,omitempty"` Code string `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"` ManualPairingCode string `protobuf:"bytes,5,opt,name=manual_pairing_code,json=manualPairingCode,proto3" json:"manual_pairing_code,omitempty"` Gender Gender `protobuf:"varint,6,opt,name=gender,proto3,enum=flexdog.catalog.product.Gender" json:"gender,omitempty"` Mpn string `protobuf:"bytes,7,opt,name=mpn,proto3" json:"mpn,omitempty"` Gtin string `protobuf:"bytes,8,opt,name=gtin,proto3" json:"gtin,omitempty"` RemoteId string `protobuf:"bytes,9,opt,name=remote_id,json=remoteId,proto3" json:"remote_id,omitempty"` ReleasedDate *timestamp.Timestamp `protobuf:"bytes,10,opt,name=released_date,json=releasedDate,proto3" json:"released_date,omitempty"` Stage Stage `protobuf:"varint,11,opt,name=stage,proto3,enum=flexdog.catalog.product.Stage" json:"stage,omitempty"` Active bool `protobuf:"varint,19,opt,name=active,proto3" json:"active,omitempty"` // referrals BrandId int32 `protobuf:"varint,12,opt,name=brand_id,json=brandId,proto3" json:"brand_id,omitempty"` ModelId int32 `protobuf:"varint,13,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"` SizeTableId *int32 `protobuf:"varint,14,opt,name=size_table_id,json=sizeTableId,proto3,oneof" json:"size_table_id,omitempty"` // metadata CreatedAt *timestamp.Timestamp `protobuf:"bytes,15,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,16,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` MainProductId *int32 `protobuf:"varint,17,opt,name=main_product_id,json=mainProductId,proto3,oneof" json:"main_product_id,omitempty"` // contains filtered or unexported fields }
func (*ProductListItem) Descriptor
deprecated
func (*ProductListItem) Descriptor() ([]byte, []int)
Deprecated: Use ProductListItem.ProtoReflect.Descriptor instead.
func (*ProductListItem) GetActive ¶
func (x *ProductListItem) GetActive() bool
func (*ProductListItem) GetBrandId ¶
func (x *ProductListItem) GetBrandId() int32
func (*ProductListItem) GetCode ¶
func (x *ProductListItem) GetCode() string
func (*ProductListItem) GetCreatedAt ¶
func (x *ProductListItem) GetCreatedAt() *timestamp.Timestamp
func (*ProductListItem) GetDescription ¶
func (x *ProductListItem) GetDescription() string
func (*ProductListItem) GetGender ¶
func (x *ProductListItem) GetGender() Gender
func (*ProductListItem) GetGtin ¶
func (x *ProductListItem) GetGtin() string
func (*ProductListItem) GetId ¶
func (x *ProductListItem) GetId() int32
func (*ProductListItem) GetMainProductId ¶
func (x *ProductListItem) GetMainProductId() int32
func (*ProductListItem) GetManualPairingCode ¶
func (x *ProductListItem) GetManualPairingCode() string
func (*ProductListItem) GetModelId ¶
func (x *ProductListItem) GetModelId() int32
func (*ProductListItem) GetMpn ¶
func (x *ProductListItem) GetMpn() string
func (*ProductListItem) GetReleasedDate ¶
func (x *ProductListItem) GetReleasedDate() *timestamp.Timestamp
func (*ProductListItem) GetRemoteId ¶
func (x *ProductListItem) GetRemoteId() string
func (*ProductListItem) GetSizeTableId ¶
func (x *ProductListItem) GetSizeTableId() int32
func (*ProductListItem) GetSlug ¶
func (x *ProductListItem) GetSlug() string
func (*ProductListItem) GetStage ¶
func (x *ProductListItem) GetStage() Stage
func (*ProductListItem) GetTitle ¶
func (x *ProductListItem) GetTitle() string
func (*ProductListItem) GetUpdatedAt ¶
func (x *ProductListItem) GetUpdatedAt() *timestamp.Timestamp
func (*ProductListItem) ProtoMessage ¶
func (*ProductListItem) ProtoMessage()
func (*ProductListItem) ProtoReflect ¶
func (x *ProductListItem) ProtoReflect() protoreflect.Message
func (*ProductListItem) Reset ¶
func (x *ProductListItem) Reset()
func (*ProductListItem) String ¶
func (x *ProductListItem) String() string
type ProductRequest ¶
type ProductRequest struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ProductRequest) Descriptor
deprecated
func (*ProductRequest) Descriptor() ([]byte, []int)
Deprecated: Use ProductRequest.ProtoReflect.Descriptor instead.
func (*ProductRequest) GetId ¶
func (x *ProductRequest) GetId() int32
func (*ProductRequest) ProtoMessage ¶
func (*ProductRequest) ProtoMessage()
func (*ProductRequest) ProtoReflect ¶
func (x *ProductRequest) ProtoReflect() protoreflect.Message
func (*ProductRequest) Reset ¶
func (x *ProductRequest) Reset()
func (*ProductRequest) String ¶
func (x *ProductRequest) String() string
type ProductService ¶
type ProductService interface { // product calls Get(context.Context, *ProductRequest) (*Product, error) IdentifyProduct(context.Context, *IdentifyProductRequest) (*IdentifiedProductResponse, error) }
func NewProductServiceJSONClient ¶
func NewProductServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ProductService
NewProductServiceJSONClient creates a JSON client that implements the ProductService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewProductServiceProtobufClient ¶
func NewProductServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ProductService
NewProductServiceProtobufClient creates a Protobuf client that implements the ProductService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type Stage ¶
type Stage int32
func (Stage) Descriptor ¶
func (Stage) Descriptor() protoreflect.EnumDescriptor
func (Stage) EnumDescriptor
deprecated
func (Stage) Number ¶
func (x Stage) Number() protoreflect.EnumNumber
func (Stage) Type ¶
func (Stage) Type() protoreflect.EnumType
type TwirpServer ¶
type TwirpServer interface { http.Handler // ServiceDescriptor returns gzipped bytes describing the .proto file that // this service was generated from. Once unzipped, the bytes can be // unmarshalled as a // github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto. // // The returned integer is the index of this particular service within that // FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a // low-level field, expected to be used for reflection. ServiceDescriptor() ([]byte, int) // ProtocGenTwirpVersion is the semantic version string of the version of // twirp used to generate this file. ProtocGenTwirpVersion() string // PathPrefix returns the HTTP URL path prefix for all methods handled by this // service. This can be used with an HTTP mux to route Twirp requests. // The path prefix is in the form: "/<prefix>/<package>.<Service>/" // that is, everything in a Twirp route except for the <Method> at the end. PathPrefix() string }
TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.
func NewProductServiceServer ¶
func NewProductServiceServer(svc ProductService, opts ...interface{}) TwirpServer
NewProductServiceServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).