example

package
v0.0.0-...-5e0d1b1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

func (*Empty) Marshal

func (m *Empty) Marshal() (dAtA []byte, err error)

func (*Empty) MarshalTo

func (m *Empty) MarshalTo(dAtA []byte) (int, error)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) Size

func (m *Empty) Size() (n int)

func (*Empty) String

func (m *Empty) String() string

func (*Empty) Unmarshal

func (m *Empty) Unmarshal(dAtA []byte) error

func (*Empty) Validate

func (m *Empty) Validate() error

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 (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

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) Addsku

func (msg *Prod) Addsku(db *xorm.Engine) error

func (*Prod) AddskuOrm

func (msg *Prod) AddskuOrm(db *xorm.Engine) error

func (*Prod) DeleteByIdXormAuto

func (msg *Prod) DeleteByIdXormAuto(db *xorm.Engine) error

func (*Prod) Descriptor

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

func (*Prod) GetById

func (msg *Prod) GetById(db *xorm.Engine) error

func (*Prod) GetByIdOrm

func (msg *Prod) GetByIdOrm(db *xorm.Engine) error

func (*Prod) GetByIdXormAuto

func (msg *Prod) GetByIdXormAuto(db *xorm.Engine) error

func (*Prod) GetByname

func (msg *Prod) GetByname(db *xorm.Engine, in *Prod) error

func (*Prod) GetDetails

func (m *Prod) GetDetails() string

func (*Prod) GetId

func (m *Prod) GetId() int64

func (*Prod) GetName

func (m *Prod) GetName() string

func (*Prod) GetSku

func (m *Prod) GetSku() *Sku

func (*Prod) GetSkus

func (m *Prod) GetSkus() []*Sku

func (*Prod) InsertXormAuto

func (msg *Prod) InsertXormAuto(db *xorm.Engine) error

func (*Prod) Marshal

func (m *Prod) Marshal() (dAtA []byte, err error)

func (*Prod) MarshalTo

func (m *Prod) MarshalTo(dAtA []byte) (int, error)

func (*Prod) ProtoMessage

func (*Prod) ProtoMessage()

func (*Prod) Reset

func (m *Prod) Reset()

func (*Prod) Size

func (m *Prod) Size() (n int)

func (*Prod) String

func (m *Prod) String() string

func (*Prod) Unmarshal

func (m *Prod) Unmarshal(dAtA []byte) error

func (*Prod) UpdateByIdXormAuto

func (msg *Prod) UpdateByIdXormAuto(db *xorm.Engine) error

func (*Prod) Validate

func (m *Prod) Validate() error

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_Marshal

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

func (*Prod) XXX_Merge

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

func (*Prod) XXX_Size

func (m *Prod) XXX_Size() int

func (*Prod) XXX_Unmarshal

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

type ProdId

type ProdId struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}

func (*ProdId) Descriptor

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

func (*ProdId) GetId

func (m *ProdId) GetId() int64

func (*ProdId) Marshal

func (m *ProdId) Marshal() (dAtA []byte, err error)

func (*ProdId) MarshalTo

func (m *ProdId) MarshalTo(dAtA []byte) (int, error)

func (*ProdId) ProtoMessage

func (*ProdId) ProtoMessage()

func (*ProdId) Reset

func (m *ProdId) Reset()

func (*ProdId) Size

func (m *ProdId) Size() (n int)

func (*ProdId) String

func (m *ProdId) String() string

func (*ProdId) Unmarshal

func (m *ProdId) Unmarshal(dAtA []byte) error

func (*ProdId) Validate

func (m *ProdId) Validate() error

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 (m *ProdId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProdId) XXX_Merge

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

func (*ProdId) XXX_Size

func (m *ProdId) XXX_Size() int

func (*ProdId) XXX_Unmarshal

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

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) DealProd

func (s *ProductImp) DealProd(c context.Context, in *Prod) (*Prod, error)

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

type ProductServer interface {
	DealProd(context.Context, *Prod) (*Prod, error)
}

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) Descriptor() ([]byte, []int)

func (*Promote) GetId

func (m *Promote) GetId() int64

func (*Promote) GetName

func (m *Promote) GetName() string

func (*Promote) GetSkuId

func (m *Promote) GetSkuId() int64

func (*Promote) Marshal

func (m *Promote) Marshal() (dAtA []byte, err error)

func (*Promote) MarshalTo

func (m *Promote) MarshalTo(dAtA []byte) (int, error)

func (*Promote) ProtoMessage

func (*Promote) ProtoMessage()

func (*Promote) Reset

func (m *Promote) Reset()

func (*Promote) Size

func (m *Promote) Size() (n int)

func (*Promote) String

func (m *Promote) String() string

func (*Promote) Unmarshal

func (m *Promote) Unmarshal(dAtA []byte) error

func (*Promote) Validate

func (m *Promote) Validate() error

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 (m *Promote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Promote) XXX_Merge

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

func (*Promote) XXX_Size

func (m *Promote) XXX_Size() int

func (*Promote) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Sku) GetBn

func (m *Sku) GetBn() string

func (*Sku) GetPrice

func (m *Sku) GetPrice() float32

func (*Sku) GetProdId

func (m *Sku) GetProdId() int64

func (*Sku) GetProm

func (m *Sku) GetProm() []*Promote

func (*Sku) GetSkuId

func (m *Sku) GetSkuId() int64

func (*Sku) GetWeight

func (m *Sku) GetWeight() float32

func (*Sku) Marshal

func (m *Sku) Marshal() (dAtA []byte, err error)

func (*Sku) MarshalTo

func (m *Sku) MarshalTo(dAtA []byte) (int, error)

func (*Sku) ProtoMessage

func (*Sku) ProtoMessage()

func (*Sku) Reset

func (m *Sku) Reset()

func (*Sku) Size

func (m *Sku) Size() (n int)

func (*Sku) String

func (m *Sku) String() string

func (*Sku) Unmarshal

func (m *Sku) Unmarshal(dAtA []byte) error

func (*Sku) Validate

func (m *Sku) Validate() error

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_Marshal

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

func (*Sku) XXX_Merge

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

func (*Sku) XXX_Size

func (m *Sku) XXX_Size() int

func (*Sku) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Test) Marshal

func (m *Test) Marshal() (dAtA []byte, err error)

func (*Test) MarshalTo

func (m *Test) MarshalTo(dAtA []byte) (int, error)

func (*Test) ProtoMessage

func (*Test) ProtoMessage()

func (*Test) Reset

func (m *Test) Reset()

func (*Test) Size

func (m *Test) Size() (n int)

func (*Test) String

func (m *Test) String() string

func (*Test) Unmarshal

func (m *Test) Unmarshal(dAtA []byte) error

func (*Test) Validate

func (m *Test) Validate() error

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_Marshal

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

func (*Test) XXX_Merge

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

func (*Test) XXX_Size

func (m *Test) XXX_Size() int

func (*Test) XXX_Unmarshal

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

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.

Jump to

Keyboard shortcuts

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