Documentation ¶
Index ¶
- Variables
- func StartHttpService() error
- func StartService() error
- type ClientConfig
- type Config
- type DatabaseConfig
- type EtcdConfig
- type HandlerServiceFunc
- type HttpServer
- type HttpServerConfig
- type HttpService
- func (h *HttpService) AddGoods(reqData []byte) (interface{}, error)
- func (h *HttpService) DeductStock(reqData []byte) (interface{}, error)
- func (h *HttpService) DelGoods(reqData []byte) (interface{}, error)
- func (h *HttpService) GetGoods(reqData []byte) (interface{}, error)
- func (h *HttpService) GetGoodsListByCategory(reqData []byte) (interface{}, error)
- func (h *HttpService) ModifyGoodsInfo(reqData []byte) (interface{}, error)
- type LogConfig
- type MongoConfig
- type RedisConfig
- type ServerConfig
- type Service
- func (s *Service) AddGoods(ctx context.Context, req *proto.AddGoodsRequest) (*proto.AddGoodsResponse, error)
- func (s *Service) AddGoodsIntoMgo(ctx context.Context, goods *model.GoogsModel) error
- func (s *Service) DeductStock(ctx context.Context, req *proto.DeductStockRequest) (*proto.DeductStockResponse, error)
- func (s *Service) DelGoods(ctx context.Context, req *proto.DelGoodsRequest) (*proto.DelGoodsResponse, error)
- func (s *Service) GetGoods(ctx context.Context, req *proto.GetGoodsRequest) (*proto.GetGoodsResponse, error)
- func (s *Service) GetGoodsListByCategory(ctx context.Context, req *proto.GetGoodsListByCategoryRequest) (*proto.GetGoodsListByCategoryResponse, error)
- func (s *Service) ModifyGoodsInfo(ctx context.Context, req *proto.ModifyGoodsInfoRequest) (*proto.ModifyGoodsInfoResponse, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
App = &Service{}
)
Functions ¶
func StartHttpService ¶
func StartHttpService() error
func StartService ¶
func StartService() error
Types ¶
type ClientConfig ¶
type ClientConfig struct {
UserServiceName string `yaml:"userServiceName" json:"userServiceName"`
}
type Config ¶
type Config struct { Log *LogConfig `yaml:"log" json:"log"` Etcd *EtcdConfig `yaml:"etcd" json:"etcd"` Server *ServerConfig `yaml:"server" json:"server"` HttpServer *HttpServerConfig `yaml:"httpServer" json:"httpServer"` Database *DatabaseConfig `yaml:"database" json:"database"` Client *ClientConfig `yaml:"client" json:"client"` Redis *RedisConfig `yaml:"redis" json:"redis"` Mongo *MongoConfig `yaml:"mongo" json:"mongo"` }
type DatabaseConfig ¶
type EtcdConfig ¶
type EtcdConfig struct {
Endpoints []string `yaml:"endpoints" json:"endpoints"`
}
type HandlerServiceFunc ¶
type HttpServer ¶
func (*HttpServer) StartHttpServer ¶
func (h *HttpServer) StartHttpServer(httpService *HttpService)
type HttpServerConfig ¶
type HttpServerConfig struct {
Port string `yaml:"port" json:"port"`
}
type HttpService ¶
type HttpService struct {
ServiceApp *Service
}
func (*HttpService) AddGoods ¶
func (h *HttpService) AddGoods(reqData []byte) (interface{}, error)
func (*HttpService) DeductStock ¶
func (h *HttpService) DeductStock(reqData []byte) (interface{}, error)
func (*HttpService) DelGoods ¶
func (h *HttpService) DelGoods(reqData []byte) (interface{}, error)
func (*HttpService) GetGoods ¶
func (h *HttpService) GetGoods(reqData []byte) (interface{}, error)
func (*HttpService) GetGoodsListByCategory ¶
func (h *HttpService) GetGoodsListByCategory(reqData []byte) (interface{}, error)
func (*HttpService) ModifyGoodsInfo ¶
func (h *HttpService) ModifyGoodsInfo(reqData []byte) (interface{}, error)
type MongoConfig ¶
type RedisConfig ¶
type ServerConfig ¶
type Service ¶
type Service struct { Config *Config RedisPool *redis.RedisPool Mongo *mongo.Client // contains filtered or unexported fields }
func (*Service) AddGoods ¶
func (s *Service) AddGoods(ctx context.Context, req *proto.AddGoodsRequest) (*proto.AddGoodsResponse, error)
func (*Service) AddGoodsIntoMgo ¶
func (*Service) DeductStock ¶
func (s *Service) DeductStock(ctx context.Context, req *proto.DeductStockRequest) (*proto.DeductStockResponse, error)
func (*Service) DelGoods ¶
func (s *Service) DelGoods(ctx context.Context, req *proto.DelGoodsRequest) (*proto.DelGoodsResponse, error)
func (*Service) GetGoods ¶
func (s *Service) GetGoods(ctx context.Context, req *proto.GetGoodsRequest) (*proto.GetGoodsResponse, error)
func (*Service) GetGoodsListByCategory ¶
func (s *Service) GetGoodsListByCategory(ctx context.Context, req *proto.GetGoodsListByCategoryRequest) (*proto.GetGoodsListByCategoryResponse, error)
func (*Service) ModifyGoodsInfo ¶
func (s *Service) ModifyGoodsInfo(ctx context.Context, req *proto.ModifyGoodsInfoRequest) (*proto.ModifyGoodsInfoResponse, error)
Click to show internal directories.
Click to hide internal directories.