server

package
v0.0.0-...-02a5af8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Name string `envconfig:"NAME" default:"product"`
	Host string `envconfig:"HOST" default:"0.0.0.0"`
	Port int    `envconfig:"PORT" default:"10011"`

	DBDriver string `envconfig:"DB_DRIVER" default:"mysql"`
	DBUrl    string `envconfig:"DB_URL" default:"root:sa@tcp(127.0.0.1:3306)/sandbox?parseTime=True"`

	PigeonStorageDriver string `envconfig:"PIGEON_STORAGE_DRIVER" default:"mysql"`
	PigeonStorageURL    string `envconfig:"PIGEON_STORAGE_URL" default:"root:sa@tcp(127.0.0.1:3306)/sandbox?parseTime=True"`
	PigeonBrokerURL     string `envconfig:"PIGEON_BROKER_URL" default:"nats://127.0.0.1:4222"`
	// contains filtered or unexported fields
}

func (*Server) Error

func (s *Server) Error() grpc.UnaryServerInterceptor

func (*Server) Logging

func (s *Server) Logging() grpc.UnaryServerInterceptor

func (*Server) Recovery

func (s *Server) Recovery() grpc.UnaryServerInterceptor

func (*Server) Serve

func (s *Server) Serve(ctx context.Context)

type Service

type Service struct {
	Store         *ent.Client
	EventSourcing *pigeon.Client
	Log           *log.Logger
}

func (*Service) CreateProduct

func (s *Service) CreateProduct(ctx context.Context, req *services.CreateProductRequest) (*resources.Empty, error)

func (*Service) DeductProductQty

func (s *Service) DeductProductQty(ctx context.Context, req *services.DeductProductQtyRequest) (*empty.Empty, error)

func (*Service) GetProduct

func (*Service) ListProducts

func (*Service) UpdateProduct

func (s *Service) UpdateProduct(ctx context.Context, req *services.UpdateProductRequest) (*resources.Empty, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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