{"modulePath":"github.com/uber/submitqueue","version":"v0.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controller\n\n## Variables\n\n```go\nvar ErrInvalidRequest = errs.NewUserError(errors.New(\"invalid request\"))\n```\nErrInvalidRequest is returned when the request fails validation. This error should be mapped to codes.InvalidArgument at the gRPC layer.\n\n## Functions\n\n```go\nfunc IsInvalidRequest(err error) bool\n```\nIsInvalidRequest returns true if any error in the error chain is ErrInvalidRequest.\n\n## Types\n\n```go\ntype IngestController struct {\n\t// contains filtered or unexported fields\n}\n```\nIngestController handles ingest business logic for stovepipe: it admits a queue's newly observed commit into the validation pipeline.\n\nIt resolves the queue's head commit URI via the SourceControl extension, dedups on the (queue, URI) pair, persists the Request and its URI mapping via storage, and publishes the request ID onto the process stage. Ingestion is idempotent: a re-reported head resolves to the already-minted request and no new work is published.\n\n```go\nfunc NewIngestController(\n\tlogger *zap.SugaredLogger,\n\tscope tally.Scope,\n\tcounter counter.Counter,\n\tsourceControl sourcecontrol.Factory,\n\tstore storage.Storage,\n\tregistry consumer.TopicRegistry,\n) *IngestController\n```\nNewIngestController creates a new instance of the stovepipe ingest controller. It publishes accepted requests to the topic registered under messagequeue.TopicKeyProcess in the registry.\n\n```go\nfunc (c *IngestController) Ingest(ctx context.Context, req *pb.IngestRequest) (resp *pb.IngestResponse, retErr error)\n```\nIngest admits a queue's newly observed commit into the validation pipeline and returns the request ID validating it.\n\nIt is idempotent and runs to completion on every call, each step tolerant of having already run: it resolves (or claims) the (queue, URI) mapping, ensures the Request row exists, and publishes the request to the process stage. A retry after a partial failure — for example the URI mapping committed but the request write failed — completes the missing steps instead of returning a dangling reference. The (queue, URI) mapping is the dedup gate, so concurrent ingests of the same head converge on one request.\n\n```go\ntype PingController struct {\n\t// contains filtered or unexported fields\n}\n```\nPingController handles ping business logic for the stovepipe\n\n```go\nfunc NewPingController(logger *zap.Logger, scope tally.Scope) *PingController\n```\nNewPingController creates a new instance of the stovepipe ping controller\n\n```go\nfunc (c *PingController) Ping(ctx context.Context, req *pb.PingRequest) (resp *pb.PingResponse, retErr error)\n```\nPing handles the ping request and returns a response\n\n","path":"github.com/uber/submitqueue/stovepipe/controller","name":"controller","synopsis":"","isRedistributable":true}
