Documentation
¶
Index ¶
- Variables
- func IsInternalConsistency(err error) bool
- func IsInvalidRequest(err error) bool
- func IsRequestNotFound(err error) bool
- func IsTooManyChangeRequests(err error) bool
- func IsUnrecognizedQueue(err error) bool
- type CancelController
- type InternalConsistencyError
- type LandController
- type ListController
- type PingController
- type RequestHistoryController
- type RequestNotFoundError
- type RequestSummaryController
- type TooManyChangeRequestsError
- type UnrecognizedQueueError
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 IsInternalConsistency ¶
IsInternalConsistency returns true if any error in the chain is an *InternalConsistencyError.
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 IsTooManyChangeRequests ¶
IsTooManyChangeRequests returns true if any error in the chain is a *TooManyChangeRequestsError.
func IsUnrecognizedQueue ¶
IsUnrecognizedQueue returns true if any error in the chain is an *UnrecognizedQueueError.
Types ¶
type CancelController ¶
type CancelController interface {
Cancel(ctx context.Context, req entity.CancelRequest) error
}
CancelController handles cancel business logic for the gateway. It validates the request, records a RequestStatusCancelling log entry (intent-only — cancellation is best-effort and may still race a successful merge), publishes a CancelRequest to the cancel topic, and returns a response. The orchestrator-side cancel controller performs the actual state transitions and emits the terminal RequestStatusCancelled log entry.
func NewCancelController ¶
func NewCancelController(logger *zap.SugaredLogger, scope tally.Scope, summaries storage.RequestSummaryStore, materializer *requestcore.Materializer, registry consumer.TopicRegistry) CancelController
NewCancelController creates a new instance of the gateway cancel controller. The controller writes a RequestStatusCancelling log entry through the shared materializer and publishes cancel requests to the topic registered under topickey.TopicKeyCancel.
type InternalConsistencyError ¶
type InternalConsistencyError struct {
Message string
}
InternalConsistencyError indicates that gateway-owned read models disagree.
func (*InternalConsistencyError) Error ¶
func (e *InternalConsistencyError) Error() string
Error implements the error interface.
type LandController ¶
type LandController interface {
Land(ctx context.Context, req entity.LandRequest) (entity.LandResult, error)
}
LandController handles land business logic for the gateway
func NewLandController ¶
func NewLandController(logger *zap.SugaredLogger, scope tally.Scope, counter counter.Counter, summaries storage.RequestSummaryStore, materializer *requestcore.Materializer, 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 topickey.TopicKeyStart in the registry.
type ListController ¶
type ListController interface {
List(ctx context.Context, req entity.ListRequest) (entity.ListResult, error)
}
ListController handles bounded queue receipt-history queries.
func NewListController ¶
func NewListController(logger *zap.SugaredLogger, scope tally.Scope, stores storage.Factory, queueConfigs queueconfig.Store) ListController
NewListController creates a gateway list controller.
type PingController ¶
type PingController interface {
Ping(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error)
}
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
type RequestHistoryController ¶
type RequestHistoryController interface {
GetRequestHistoryByID(ctx context.Context, req entity.GetRequestHistoryByIDRequest) ([]entity.RequestLog, error)
GetRequestHistoryByChangeURI(ctx context.Context, req entity.GetRequestHistoryByChangeURIRequest) ([]entity.RequestHistory, error)
}
RequestHistoryController handles retained request-log history lookups.
func NewRequestHistoryController ¶
func NewRequestHistoryController(logger *zap.SugaredLogger, scope tally.Scope, requestLogStore storage.RequestLogStore, requestURIStore storage.RequestURIStore) RequestHistoryController
NewRequestHistoryController creates a gateway request-history controller.
type RequestNotFoundError ¶
RequestNotFoundError indicates that no request exists for the selected sqid or change URI.
func (*RequestNotFoundError) Error ¶
func (e *RequestNotFoundError) Error() string
Error implements the error interface.
type RequestSummaryController ¶
type RequestSummaryController interface {
GetRequestSummaryByID(ctx context.Context, req entity.GetRequestSummaryByIDRequest) (entity.RequestSummary, error)
GetRequestSummaryByChangeURI(ctx context.Context, req entity.GetRequestSummaryByChangeURIRequest) ([]entity.RequestSummary, error)
}
RequestSummaryController handles materialized request-summary lookups for the gateway.
func NewRequestSummaryController ¶
func NewRequestSummaryController(logger *zap.SugaredLogger, scope tally.Scope, requestSummaryStore storage.RequestSummaryStore, requestURIStore storage.RequestURIStore) RequestSummaryController
NewRequestSummaryController creates a gateway request-summary controller.
type TooManyChangeRequestsError ¶
TooManyChangeRequestsError indicates that a change URI exceeded the API result limit.
func (*TooManyChangeRequestsError) Error ¶
func (e *TooManyChangeRequestsError) Error() string
Error implements the error interface.
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.