File tree Expand file tree Collapse file tree 6 files changed +25
-17
lines changed Expand file tree Collapse file tree 6 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ module github.com/fermyon/spin-redirect
22
33go 1.24
44
5- require github.com/fermyon /spin/sdk/go v1.4.2
5+ require github.com/spinframework /spin-go-sdk v0.0.0-20250310233821-2665ad7e30a4
66
77require github.com/julienschmidt/httprouter v1.3.0 // indirect
8+
9+ replace github.com/spinframework/spin-go-sdk => github.com/fermyon/spin-go-sdk v0.0.0-20250310233821-2665ad7e30a4
Original file line number Diff line number Diff line change 1- github.com/fermyon/spin/sdk/go v1.4.2 h1:4U2J2WooKptCa4zeBetKctz/DEJxv3RvGauW0bZ+e6U =
2- github.com/fermyon/spin/sdk/go v1.4.2 /go.mod h1:yb8lGesopgj/GwPzLPATxcOeqWZT/HjrzEFfwbztAXE =
1+ github.com/fermyon/spin-go-sdk v0.0.0-20250310233821-2665ad7e30a4 h1:er/5jOnjXEjx95+7iiioj5l/CwT5AQgM7Udr8xM/mDI =
2+ github.com/fermyon/spin-go-sdk v0.0.0-20250310233821-2665ad7e30a4 /go.mod h1:9GoW1+MR0gN1OEinITtjPOzmu0dur3U6ty3pIH/gN24 =
33github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U =
44github.com/julienschmidt/httprouter v1.3.0 /go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM =
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ spinhttp "github.com/spinframework/spin-go-sdk/http"
5+
6+ "github.com/fermyon/spin-redirect/redirect"
7+ )
8+
9+ func init () {
10+ r := redirect .NewSpinRedirect ()
11+ spinhttp .Handle (r .HandleFunc )
12+ }
13+
14+ func main () {
15+ }
Original file line number Diff line number Diff line change 1- package main
1+ package redirect
22
33import (
44 "os"
55 "strings"
66
7- config "github.com/fermyon /spin/ sdk/go/config "
7+ config "github.com/spinframework /spin-go- sdk/variables "
88)
99
1010type ConfigReader interface {
Original file line number Diff line number Diff line change 1- package main
1+ package redirect
22
33import (
44 "net/http"
55 "net/url"
66 "path"
77 "strconv"
88 "strings"
9-
10- spinhttp "github.com/fermyon/spin/sdk/go/http"
119)
1210
1311const (
@@ -25,14 +23,6 @@ const (
2523 trimPrefixKey string = "trim_prefix"
2624)
2725
28- func init () {
29- r := NewSpinRedirect ()
30- spinhttp .Handle (r .handleFunc )
31- }
32-
33- func main () {
34- }
35-
3626// SpinRedirect is a struct that provides a handleFunc
3727// for redirecting to a destination URL using configurable HTTP status code.
3828type SpinRedirect struct {
@@ -46,7 +36,7 @@ func NewSpinRedirect() SpinRedirect {
4636 }
4737}
4838
49- func (s SpinRedirect ) handleFunc (w http.ResponseWriter , r * http.Request ) {
39+ func (s SpinRedirect ) HandleFunc (w http.ResponseWriter , r * http.Request ) {
5040 dest , _ := s .getDestination ()
5141 code , _ := s .getStatusCode (r .Method )
5242
Original file line number Diff line number Diff line change 1+ package redirect
You can’t perform that action at this time.
0 commit comments