-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improve sink feedback so smart stuff can be built on it * but not that * cleanup logging, etc * Rethink manifold * add retry after headers * but actually set the header * make relay retry faster * make manifold distribution errors a little more obvious * clean up topic <-> stream config * Scrap manifold conifg * bump quickstart and devel version
- Loading branch information
Showing
37 changed files
with
505 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.5.1 | ||
v0.5.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
package config | ||
|
||
type Manifold struct { | ||
BufferRecordThreshold int `json:"bufferRecordThreshold"` | ||
BufferByteThreshold int `json:"bufferByteThreshold"` | ||
BufferTimeThreshold int `json:"bufferTimeThreshold"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
package handler | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/gin-gonic/gin" | ||
"github.com/silverton-io/honeypot/pkg/envelope" | ||
"github.com/silverton-io/honeypot/pkg/response" | ||
) | ||
|
||
// RelayHandler processes incoming envelopes, splits them in half, | ||
// and sends them to the configured sink. It relies on upstream validation. | ||
func RelayHandler(h EventHandlerParams) gin.HandlerFunc { | ||
fn := func(c *gin.Context) { | ||
envelopes := envelope.BuildRelayEnvelopesFromRequest(c) | ||
h.Manifold.Enqueue(envelopes) | ||
err := h.Manifold.Distribute(envelopes) | ||
if err != nil { | ||
c.Header("Retry-After", response.RETRY_AFTER_3) | ||
c.JSON(http.StatusServiceUnavailable, response.ManifoldDistributionError) | ||
} else { | ||
c.JSON(200, response.Ok) | ||
} | ||
} | ||
return gin.HandlerFunc(fn) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.