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
$ curl -i http://localhost:8080/admin/health.json?type=short | |
HTTP/1.1 200 OK | |
Content-Type: application/json | |
Date: Wed, 17 Jul 2019 12:54:18 GMT | |
Content-Length: 35 | |
{ | |
"resolve.example.com": "PASS" | |
} |
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
$ curl -i http://localhost:8080/admin/health.json | |
HTTP/1.1 200 OK | |
Content-Type: application/json | |
Date: Wed, 17 Jul 2019 12:54:20 GMT | |
Content-Length: 208 | |
{ | |
"resolve.example.com": { | |
"message": "[2] results were resolved", | |
"timestamp": "2019-07-17T15:54:18.225468956+03:00", |
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
http.Handle("/admin/health.json", healthhttp.HandleHealthJSON(h)) |
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
import ( | |
"time" | |
health "github.com/AppsFlyer/go-sundheit" | |
"github.com/AppsFlyer/go-sundheit/checks" | |
) | |
func registerHealthChecks() { | |
// create a new health instance |
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
http.HandleFunc("/health", func(w http.ResponseWriter, request *http.Request) { | |
w.WriteHeader(200) | |
}) | |
log.Fatal(http.ListenAndServe(":8080", nil)) |
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
import ( | |
"context" | |
"fmt" | |
"net" | |
"time" | |
"github.com/AppsFlyer/go-sundheit/checks" | |
"github.com/pkg/errors" | |
) |
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
import ( | |
"context" | |
"fmt" | |
"net" | |
"time" | |
"github.com/AppsFlyer/go-sundheit/checks" | |
"github.com/pkg/errors" | |
) |
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
(defn listenablefuture-handler | |
[lf on-success-func on-fail-func] | |
(Futures/addCallback | |
lf | |
(reify FutureCallback | |
(onSuccess [_ res] | |
(on-success-func res)) | |
(onFailure [_ e] | |
(on-fail-func e)))) | |
lf) |
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
package com.outbrain.ob1k.server.netty; | |
import static io.netty.handler.codec.http.HttpHeaders.Names.CONNECTION; | |
import static io.netty.handler.codec.http.HttpHeaders.Names.CONTENT_TYPE; | |
import static io.netty.handler.codec.http.HttpHeaders.Names.DATE; | |
import static io.netty.handler.codec.http.HttpHeaders.Names.IF_MODIFIED_SINCE; | |
import static io.netty.handler.codec.http.HttpHeaders.isKeepAlive; | |
import static io.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST; | |
import static io.netty.handler.codec.http.HttpResponseStatus.NOT_MODIFIED; | |
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; |
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
package com.outbrain.gruffalo.publish; | |
import java.util.concurrent.TimeUnit; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import io.netty.bootstrap.Bootstrap; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelHandler; |
NewerOlder