Documentation ¶
Index ¶
- func MakeGetBoxesHTTPHandler(ep endpoint.Endpoint, logger log.Logger, options ...kitHTTP.ServerOption) *kitHTTP.Server
- func MakeMakeBoxHTTPHandler(ep endpoint.Endpoint, logger log.Logger, options ...kitHTTP.ServerOption) *kitHTTP.Server
- func MakeStatusHTTPHandler(ep endpoint.Endpoint, logger log.Logger, options ...kitHTTP.ServerOption) *kitHTTP.Server
- func NewClient(conn *grpc.ClientConn, logger log.Logger, options ...kitGRPC.ClientOption) *grpcClient
- func NewPBFromBoolValue(msg *BoolValue) *pb.BoolValue
- func NewPBFromBoxSpecification(msg *BoxSpecification) *pb.BoxSpecification
- func NewPBFromBoxes(msg *Boxes) *pb.Boxes
- func NewPBFromEmpty(msg *Empty) *pb.Empty
- func NewPBFromStatusMessage(msg *StatusMessage) *pb.StatusMessage
- func NewPBFromStringValue(msg *StringValue) *pb.StringValue
- func RegisterHandlers(router *mux.Router, endpoints Endpoints, logger log.Logger, ...)
- type BoolValue
- type BoxSpecification
- type Boxes
- type Empty
- type Endpoints
- type GRPCServer
- type Repository
- type Service
- type StatusMessage
- type StringValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeGetBoxesHTTPHandler ¶
func MakeMakeBoxHTTPHandler ¶
func MakeStatusHTTPHandler ¶
func NewClient ¶
func NewClient(conn *grpc.ClientConn, logger log.Logger, options ...kitGRPC.ClientOption) *grpcClient
func NewPBFromBoolValue ¶
transformer *BoolValue to *pb.BoolValue
func NewPBFromBoxSpecification ¶
func NewPBFromBoxSpecification(msg *BoxSpecification) *pb.BoxSpecification
transformer *BoxSpecification to *pb.BoxSpecification
func NewPBFromStatusMessage ¶
func NewPBFromStatusMessage(msg *StatusMessage) *pb.StatusMessage
transformer *StatusMessage to *pb.StatusMessage
func NewPBFromStringValue ¶
func NewPBFromStringValue(msg *StringValue) *pb.StringValue
transformer *StringValue to *pb.StringValue
func RegisterHandlers ¶
Types ¶
type BoolValue ¶
type BoolValue struct {
Value bool
}
func NewBoolValueFromPB ¶
transformer *pb.BoolValue to *BoolValue
type BoxSpecification ¶
func NewBoxSpecificationFromPB ¶
func NewBoxSpecificationFromPB(msg *pb.BoxSpecification) *BoxSpecification
transformer *pb.BoxSpecification to *BoxSpecification
type Boxes ¶
type Boxes struct {
Boxes []BoxSpecification
}
type Endpoints ¶
type Endpoints struct { MakeBoxEndpoint endpoint.Endpoint GetBoxesEndpoint endpoint.Endpoint StatusEndpoint endpoint.Endpoint }
func MakeEndpoints ¶
func MakeEndpoints(svc Service, mwares []endpoint.Middleware) Endpoints
type GRPCServer ¶
type GRPCServer struct { MakeBoxGRPCHandler kitGRPC.Handler GetBoxesGRPCHandler kitGRPC.Handler StatusGRPCHandler kitGRPC.Handler // contains filtered or unexported fields }
func NewGRPCServer ¶
func NewGRPCServer(endpoints Endpoints, logger log.Logger, options ...kitGRPC.ServerOption) (*GRPCServer, error)
func (*GRPCServer) MakeBox ¶
func (s *GRPCServer) MakeBox(ctx context.Context, req *pb.BoxSpecification) (*pb.Empty, error)
protobuf implementation : no streaming for MakeBox
func (*GRPCServer) Status ¶
func (s *GRPCServer) Status(ctx context.Context, req *pb.Empty) (*pb.StatusMessage, error)
protobuf implementation : no streaming for Status
type Repository ¶
type Repository interface { MakeBox(ctx context.Context, name string, height int32, width int32, depth int32) (int32, int32, error) GetBoxes(ctx context.Context, page int32, perPage int32) ([]BoxSpecification, error) Status(ctx context.Context, page int32, perPage int32) (string, bool, error) }
*
type MysqlConfig struct { Host string `env:"DB_READ_HOST" envDefault:"local-factory"` Port string `env:"DB_READ_PORT" envDefault:"3306"` ConnectionTimeout int `env:"DB_READ_CONNECTION_TIMEOUT" envDefault:"5"` MaxConnLifetime int `env:"DB_READ_MAX_CONN_LIFETIME" envDefault:"0"` MaxIdleConns int `env:"DB_READ_MAX_IDLE_CONNS" envDefault:"2"` MaxOpenConns int `env:"DB_READ_MAX_OPEN_CONNS" envDefault:"0"` ReadTimeout int `env:"DB_READ_READ_TIMEOUT" envDefault:"360"` Username string `env:"DB_READ_USERNAME" envDefault:"root"` Password string `env:"DB_READ_PASSWORD" envDefault:"foobar"` DatabaseName string `env:"DB_READ_DATABASE" envDefault:"factory"` }
* *
*
func NewRepository ¶
func NewRepository(logger log.Logger, db interface{}) Repository
type Service ¶
type Service interface { MakeBox(ctx context.Context, name string, height int32, width int32, depth int32) (int32, int32, error) GetBoxes(ctx context.Context, page int32, perPage int32) ([]BoxSpecification, error) Status(ctx context.Context, page int32, perPage int32) (string, bool, error) Log() log.Logger }
func NewHTTPClient ¶
func NewService ¶
func NewService(log log.Logger, repo Repository) Service
type StatusMessage ¶
func NewStatusMessageFromPB ¶
func NewStatusMessageFromPB(msg *pb.StatusMessage) *StatusMessage
transformer *pb.StatusMessage to *StatusMessage
type StringValue ¶
func NewStringValueFromPB ¶
func NewStringValueFromPB(msg *pb.StringValue) *StringValue
transformer *pb.StringValue to *StringValue
Click to show internal directories.
Click to hide internal directories.