Documentation
¶
Index ¶
- Variables
- func RegisterProductServer(s *grpc.Server, srv ProductServer)
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (m *Empty) Marshal() (dAtA []byte, err error)
- func (m *Empty) MarshalTo(dAtA []byte) (int, error)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) Size() (n int)
- func (m *Empty) String() string
- func (m *Empty) Unmarshal(dAtA []byte) error
- func (m *Empty) Validate() error
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type EmptyValidationError
- type Prod
- func (msg *Prod) Addsku(db *xorm.Engine) error
- func (msg *Prod) AddskuOrm(db *xorm.Engine) error
- func (msg *Prod) DeleteByIdXormAuto(db *xorm.Engine) error
- func (*Prod) Descriptor() ([]byte, []int)
- func (msg *Prod) GetById(db *xorm.Engine) error
- func (msg *Prod) GetByIdOrm(db *xorm.Engine) error
- func (msg *Prod) GetByIdXormAuto(db *xorm.Engine) error
- func (msg *Prod) GetByname(db *xorm.Engine, in *Prod) error
- func (m *Prod) GetDetails() string
- func (m *Prod) GetId() int64
- func (m *Prod) GetName() string
- func (m *Prod) GetSku() *Sku
- func (m *Prod) GetSkus() []*Sku
- func (msg *Prod) InsertXormAuto(db *xorm.Engine) error
- func (m *Prod) Marshal() (dAtA []byte, err error)
- func (m *Prod) MarshalTo(dAtA []byte) (int, error)
- func (*Prod) ProtoMessage()
- func (m *Prod) Reset()
- func (m *Prod) Size() (n int)
- func (m *Prod) String() string
- func (m *Prod) Unmarshal(dAtA []byte) error
- func (msg *Prod) UpdateByIdXormAuto(db *xorm.Engine) error
- func (m *Prod) Validate() error
- func (m *Prod) XXX_DiscardUnknown()
- func (m *Prod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Prod) XXX_Merge(src proto.Message)
- func (m *Prod) XXX_Size() int
- func (m *Prod) XXX_Unmarshal(b []byte) error
- type ProdId
- func (*ProdId) Descriptor() ([]byte, []int)
- func (m *ProdId) GetId() int64
- func (m *ProdId) Marshal() (dAtA []byte, err error)
- func (m *ProdId) MarshalTo(dAtA []byte) (int, error)
- func (*ProdId) ProtoMessage()
- func (m *ProdId) Reset()
- func (m *ProdId) Size() (n int)
- func (m *ProdId) String() string
- func (m *ProdId) Unmarshal(dAtA []byte) error
- func (m *ProdId) Validate() error
- func (m *ProdId) XXX_DiscardUnknown()
- func (m *ProdId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProdId) XXX_Merge(src proto.Message)
- func (m *ProdId) XXX_Size() int
- func (m *ProdId) XXX_Unmarshal(b []byte) error
- type ProdIdValidationError
- type ProdValidationError
- type ProductClient
- type ProductImp
- type ProductServer
- type Promote
- func (*Promote) Descriptor() ([]byte, []int)
- func (m *Promote) GetId() int64
- func (m *Promote) GetName() string
- func (m *Promote) GetSkuId() int64
- func (m *Promote) Marshal() (dAtA []byte, err error)
- func (m *Promote) MarshalTo(dAtA []byte) (int, error)
- func (*Promote) ProtoMessage()
- func (m *Promote) Reset()
- func (m *Promote) Size() (n int)
- func (m *Promote) String() string
- func (m *Promote) Unmarshal(dAtA []byte) error
- func (m *Promote) Validate() error
- func (m *Promote) XXX_DiscardUnknown()
- func (m *Promote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Promote) XXX_Merge(src proto.Message)
- func (m *Promote) XXX_Size() int
- func (m *Promote) XXX_Unmarshal(b []byte) error
- type PromoteValidationError
- type Sku
- func (*Sku) Descriptor() ([]byte, []int)
- func (m *Sku) GetBn() string
- func (m *Sku) GetPrice() float32
- func (m *Sku) GetProdId() int64
- func (m *Sku) GetProm() []*Promote
- func (m *Sku) GetSkuId() int64
- func (m *Sku) GetWeight() float32
- func (m *Sku) Marshal() (dAtA []byte, err error)
- func (m *Sku) MarshalTo(dAtA []byte) (int, error)
- func (*Sku) ProtoMessage()
- func (m *Sku) Reset()
- func (m *Sku) Size() (n int)
- func (m *Sku) String() string
- func (m *Sku) Unmarshal(dAtA []byte) error
- func (m *Sku) Validate() error
- func (m *Sku) XXX_DiscardUnknown()
- func (m *Sku) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Sku) XXX_Merge(src proto.Message)
- func (m *Sku) XXX_Size() int
- func (m *Sku) XXX_Unmarshal(b []byte) error
- type SkuValidationError
- type Test
- func (*Test) Descriptor() ([]byte, []int)
- func (m *Test) Marshal() (dAtA []byte, err error)
- func (m *Test) MarshalTo(dAtA []byte) (int, error)
- func (*Test) ProtoMessage()
- func (m *Test) Reset()
- func (m *Test) Size() (n int)
- func (m *Test) String() string
- func (m *Test) Unmarshal(dAtA []byte) error
- func (m *Test) Validate() error
- func (m *Test) XXX_DiscardUnknown()
- func (m *Test) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Test) XXX_Merge(src proto.Message)
- func (m *Test) XXX_Size() int
- func (m *Test) XXX_Unmarshal(b []byte) error
- type TestValidationError
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthProd = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowProd = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterProductServer ¶
func RegisterProductServer(s *grpc.Server, srv ProductServer)
Types ¶
type Empty ¶
type Empty struct { }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) Validate ¶
Validate checks the field values on Empty with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type EmptyValidationError ¶
type EmptyValidationError struct {
// contains filtered or unexported fields
}
EmptyValidationError is the validation error returned by Empty.Validate if the designated constraints aren't met.
func (EmptyValidationError) Cause ¶
func (e EmptyValidationError) Cause() error
Cause function returns cause value.
func (EmptyValidationError) Error ¶
func (e EmptyValidationError) Error() string
Error satisfies the builtin error interface
func (EmptyValidationError) ErrorName ¶
func (e EmptyValidationError) ErrorName() string
ErrorName returns error name.
func (EmptyValidationError) Field ¶
func (e EmptyValidationError) Field() string
Field function returns field value.
func (EmptyValidationError) Key ¶
func (e EmptyValidationError) Key() bool
Key function returns key value.
func (EmptyValidationError) Reason ¶
func (e EmptyValidationError) Reason() string
Reason function returns reason value.
type Prod ¶
type Prod struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Details string `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"` Skus []*Sku `protobuf:"bytes,4,rep,name=skus,proto3" json:"skus,omitempty"` Sku *Sku `protobuf:"bytes,5,opt,name=sku,proto3" json:"sku,omitempty"` }
func (*Prod) Descriptor ¶
func (*Prod) GetDetails ¶
func (*Prod) ProtoMessage ¶
func (*Prod) ProtoMessage()
func (*Prod) Validate ¶
Validate checks the field values on Prod with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Prod) XXX_DiscardUnknown ¶
func (m *Prod) XXX_DiscardUnknown()
func (*Prod) XXX_Unmarshal ¶
type ProdId ¶
type ProdId struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (*ProdId) Descriptor ¶
func (*ProdId) ProtoMessage ¶
func (*ProdId) ProtoMessage()
func (*ProdId) Validate ¶
Validate checks the field values on ProdId with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*ProdId) XXX_DiscardUnknown ¶
func (m *ProdId) XXX_DiscardUnknown()
func (*ProdId) XXX_Marshal ¶
func (*ProdId) XXX_Unmarshal ¶
type ProdIdValidationError ¶
type ProdIdValidationError struct {
// contains filtered or unexported fields
}
ProdIdValidationError is the validation error returned by ProdId.Validate if the designated constraints aren't met.
func (ProdIdValidationError) Cause ¶
func (e ProdIdValidationError) Cause() error
Cause function returns cause value.
func (ProdIdValidationError) Error ¶
func (e ProdIdValidationError) Error() string
Error satisfies the builtin error interface
func (ProdIdValidationError) ErrorName ¶
func (e ProdIdValidationError) ErrorName() string
ErrorName returns error name.
func (ProdIdValidationError) Field ¶
func (e ProdIdValidationError) Field() string
Field function returns field value.
func (ProdIdValidationError) Key ¶
func (e ProdIdValidationError) Key() bool
Key function returns key value.
func (ProdIdValidationError) Reason ¶
func (e ProdIdValidationError) Reason() string
Reason function returns reason value.
type ProdValidationError ¶
type ProdValidationError struct {
// contains filtered or unexported fields
}
ProdValidationError is the validation error returned by Prod.Validate if the designated constraints aren't met.
func (ProdValidationError) Cause ¶
func (e ProdValidationError) Cause() error
Cause function returns cause value.
func (ProdValidationError) Error ¶
func (e ProdValidationError) Error() string
Error satisfies the builtin error interface
func (ProdValidationError) ErrorName ¶
func (e ProdValidationError) ErrorName() string
ErrorName returns error name.
func (ProdValidationError) Field ¶
func (e ProdValidationError) Field() string
Field function returns field value.
func (ProdValidationError) Key ¶
func (e ProdValidationError) Key() bool
Key function returns key value.
func (ProdValidationError) Reason ¶
func (e ProdValidationError) Reason() string
Reason function returns reason value.
type ProductClient ¶
type ProductClient interface {
DealProd(ctx context.Context, in *Prod, opts ...grpc.CallOption) (*Prod, error)
}
ProductClient is the client API for Product service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewProductClient ¶
func NewProductClient(cc *grpc.ClientConn) ProductClient
type ProductImp ¶
type ProductImp struct {
// contains filtered or unexported fields
}
func NewProductImp ¶
func NewProductImp(db *xorm.Engine) ProductImp
func (*ProductImp) DealProdHandler ¶
func (s *ProductImp) DealProdHandler(c *gin.Context)
func (*ProductImp) InitApi ¶
func (s *ProductImp) InitApi(g *gin.RouterGroup)
func (*ProductImp) NewBalancerClient ¶
func (s *ProductImp) NewBalancerClient(target string) ProductClient
type ProductServer ¶
ProductServer is the server API for Product service.
type Promote ¶
type Promote struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` SkuId int64 `protobuf:"varint,3,opt,name=skuId,proto3" json:"skuId,omitempty"` }
func (*Promote) Descriptor ¶
func (*Promote) ProtoMessage ¶
func (*Promote) ProtoMessage()
func (*Promote) Validate ¶
Validate checks the field values on Promote with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Promote) XXX_DiscardUnknown ¶
func (m *Promote) XXX_DiscardUnknown()
func (*Promote) XXX_Marshal ¶
func (*Promote) XXX_Unmarshal ¶
type PromoteValidationError ¶
type PromoteValidationError struct {
// contains filtered or unexported fields
}
PromoteValidationError is the validation error returned by Promote.Validate if the designated constraints aren't met.
func (PromoteValidationError) Cause ¶
func (e PromoteValidationError) Cause() error
Cause function returns cause value.
func (PromoteValidationError) Error ¶
func (e PromoteValidationError) Error() string
Error satisfies the builtin error interface
func (PromoteValidationError) ErrorName ¶
func (e PromoteValidationError) ErrorName() string
ErrorName returns error name.
func (PromoteValidationError) Field ¶
func (e PromoteValidationError) Field() string
Field function returns field value.
func (PromoteValidationError) Key ¶
func (e PromoteValidationError) Key() bool
Key function returns key value.
func (PromoteValidationError) Reason ¶
func (e PromoteValidationError) Reason() string
Reason function returns reason value.
type Sku ¶
type Sku struct { SkuId int64 `protobuf:"varint,1,opt,name=skuId,proto3" json:"skuId,omitempty"` Price float32 `protobuf:"fixed32,2,opt,name=price,proto3" json:"price,omitempty"` Bn string `protobuf:"bytes,3,opt,name=bn,proto3" json:"bn,omitempty"` Weight float32 `protobuf:"fixed32,4,opt,name=weight,proto3" json:"weight,omitempty"` ProdId int64 `protobuf:"varint,5,opt,name=prodId,proto3" json:"prodId,omitempty"` Prom []*Promote `protobuf:"bytes,6,rep,name=prom,proto3" json:"prom,omitempty"` }
func (*Sku) Descriptor ¶
func (*Sku) ProtoMessage ¶
func (*Sku) ProtoMessage()
func (*Sku) Validate ¶
Validate checks the field values on Sku with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Sku) XXX_DiscardUnknown ¶
func (m *Sku) XXX_DiscardUnknown()
func (*Sku) XXX_Unmarshal ¶
type SkuValidationError ¶
type SkuValidationError struct {
// contains filtered or unexported fields
}
SkuValidationError is the validation error returned by Sku.Validate if the designated constraints aren't met.
func (SkuValidationError) Cause ¶
func (e SkuValidationError) Cause() error
Cause function returns cause value.
func (SkuValidationError) Error ¶
func (e SkuValidationError) Error() string
Error satisfies the builtin error interface
func (SkuValidationError) ErrorName ¶
func (e SkuValidationError) ErrorName() string
ErrorName returns error name.
func (SkuValidationError) Field ¶
func (e SkuValidationError) Field() string
Field function returns field value.
func (SkuValidationError) Key ¶
func (e SkuValidationError) Key() bool
Key function returns key value.
func (SkuValidationError) Reason ¶
func (e SkuValidationError) Reason() string
Reason function returns reason value.
type Test ¶
type Test struct { }
func (*Test) Descriptor ¶
func (*Test) ProtoMessage ¶
func (*Test) ProtoMessage()
func (*Test) Validate ¶
Validate checks the field values on Test with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
func (*Test) XXX_DiscardUnknown ¶
func (m *Test) XXX_DiscardUnknown()
func (*Test) XXX_Unmarshal ¶
type TestValidationError ¶
type TestValidationError struct {
// contains filtered or unexported fields
}
TestValidationError is the validation error returned by Test.Validate if the designated constraints aren't met.
func (TestValidationError) Cause ¶
func (e TestValidationError) Cause() error
Cause function returns cause value.
func (TestValidationError) Error ¶
func (e TestValidationError) Error() string
Error satisfies the builtin error interface
func (TestValidationError) ErrorName ¶
func (e TestValidationError) ErrorName() string
ErrorName returns error name.
func (TestValidationError) Field ¶
func (e TestValidationError) Field() string
Field function returns field value.
func (TestValidationError) Key ¶
func (e TestValidationError) Key() bool
Key function returns key value.
func (TestValidationError) Reason ¶
func (e TestValidationError) Reason() string
Reason function returns reason value.