Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidRequest = errs.NewUserError(errors.New("invalid request"))
ErrInvalidRequest is returned when the request fails validation. This error should be mapped to codes.InvalidArgument at the gRPC layer.
Functions ¶
func IsInvalidRequest ¶
IsInvalidRequest returns true if any error in the error chain is ErrInvalidRequest.
func IsRequestNotFound ¶
IsRequestNotFound returns true if any error in the chain is a *RequestNotFoundError.
func IsUnrecognizedQueue ¶
IsUnrecognizedQueue returns true if any error in the chain is an *UnrecognizedQueueError.
Types ¶
type LandController ¶
type LandController struct {
// contains filtered or unexported fields
}
LandController handles land business logic for the gateway
func NewLandController ¶
func NewLandController(logger *zap.SugaredLogger, scope tally.Scope, counter counter.Counter, requestLogStore storage.RequestLogStore, queueConfigs queueconfig.Store, registry consumer.TopicRegistry) *LandController
NewLandController creates a new instance of the gateway land controller. The controller publishes land requests to the topic registered under consumer.TopicKeyStart in the registry.
func (*LandController) Land ¶
func (c *LandController) Land(ctx context.Context, req *pb.LandRequest) (resp *pb.LandResponse, retErr error)
Land handles the land request and returns a response
type PingController ¶
type PingController struct {
// contains filtered or unexported fields
}
PingController handles ping business logic for the gateway
func NewPingController ¶
func NewPingController(logger *zap.Logger, scope tally.Scope) *PingController
NewPingController creates a new instance of the gateway ping controller
func (*PingController) Ping ¶
func (c *PingController) Ping(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error)
Ping handles the ping request and returns a response
type RequestNotFoundError ¶
type RequestNotFoundError struct {
Sqid string
}
RequestNotFoundError indicates that no request log records exist for the requested sqid. Either the sqid is wrong or the request has not been accepted yet.
func (*RequestNotFoundError) Error ¶
func (e *RequestNotFoundError) Error() string
Error implements the error interface.
type StatusController ¶
type StatusController struct {
// contains filtered or unexported fields
}
StatusController handles request status business logic for the gateway.
func NewStatusController ¶
func NewStatusController(logger *zap.SugaredLogger, scope tally.Scope, requestLogStore storage.RequestLogStore) *StatusController
NewStatusController creates a new instance of the gateway status controller.
func (*StatusController) Status ¶
func (c *StatusController) Status(ctx context.Context, req *pb.StatusRequest) (*pb.StatusResponse, error)
Status returns the current reconciled status of a request identified by its sqid.
type UnrecognizedQueueError ¶
type UnrecognizedQueueError struct {
Queue string
}
UnrecognizedQueueError indicates the request named a queue that is not present in the queue configuration store.
func (*UnrecognizedQueueError) Error ¶
func (e *UnrecognizedQueueError) Error() string
Error implements the error interface.