Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const (
// DivertHeaderName is the header used for divert values.
DivertHeaderName = "x-okteto-dvrt"
)
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext provides the divert header value stored in context.
func FromHeaders ¶
FromHeaders extracts divert headers from an http request and provides the value. If missing then empty string is provided.
func InjectDivertHeader ¶
InjectDivertHeader is an http middleware handler that injects Okteto divert headers into context from http.Request.
Example ¶
appHandler := func(w http.ResponseWriter, _ *http.Request) { io.WriteString(w, "This is your application's handler\n") } injectionHandler := InjectDivertHeader() http.Handle("/", injectionHandler(http.HandlerFunc(appHandler))) log.Fatal(http.ListenAndServe(":8080", nil))
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.