From 161bc5853a75c43b4cab820c3dce72abc5ad743b Mon Sep 17 00:00:00 2001 From: Rangel Reale Date: Mon, 16 Oct 2023 09:00:02 -0300 Subject: [PATCH] transfer to org --- README.md | 14 +++++++------- alias.go | 4 ++-- ctx.go | 2 +- decode.go | 4 ++-- decode_type.go | 4 ++-- example_decode_test.go | 4 ++-- example_decoder_test.go | 4 ++-- example_decodetype_test.go | 4 ++-- example_typedecoder_test.go | 4 ++-- go.mod | 4 ++-- go.sum | 4 ++-- operation.go | 2 +- option.go | 4 ++-- option_internal.go | 4 ++-- options.go | 2 +- resolver/resolver.go | 2 +- resolver/resolver_value.go | 2 +- 17 files changed, 34 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 8538b48..97410ed 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # InReq - Golang http request to struct -[![GoDoc](https://godoc.org/github.com/RangelReale/inreq?status.png)](https://godoc.org/github.com/RangelReale/inreq) +[![GoDoc](https://godoc.org/github.com/rrgmc/inreq?status.png)](https://godoc.org/github.com/rrgmc/inreq) InReq is a Golang library to extract information from `*http.Request` into structs. It does this using struct tags and/or a configuration map. @@ -21,7 +21,7 @@ import ( "net/http" "strings" - "github.com/RangelReale/inreq" + "github.com/rrgmc/inreq" ) type InputBody struct { @@ -55,7 +55,7 @@ func main() { data := &Input{} err = inreq.Decode(r, data, - // usually this will be a framework-specific implementation, like "github.com/RangelReale/inreq-path/gorillamux". + // usually this will be a framework-specific implementation, like "github.com/rrgmc/inreq-path/gorillamux". inreq.WithPathValue(inreq.PathValueFunc(func(r *http.Request, name string) (found bool, value any, err error) { if name == "deviceid" { return true, "12345", err @@ -92,7 +92,7 @@ import ( "net/http" "strings" - "github.com/RangelReale/inreq" + "github.com/rrgmc/inreq" ) type InputTypeBody struct { @@ -124,7 +124,7 @@ func main() { r.Form.Add("devicename", "form-device-name") data, err := inreq.DecodeType[InputType](r, - // usually this will be a framework-specific implementation, like "github.com/RangelReale/inreq-path/gorillamux". + // usually this will be a framework-specific implementation, like "github.com/rrgmc/inreq-path/gorillamux". inreq.WithPathValue(inreq.PathValueFunc(func(r *http.Request, name string) (found bool, value any, err error) { if name == "deviceid" { return true, "12345", err @@ -184,7 +184,7 @@ func main() { A path isn't an HTTP concept, but usually http frameworks have a concept of `routes` which can contain path variables, a framework-specific function should be set using `WithPathValue`. Some of these are available a -[https://github.com/RangelReale/inreq-path](https://github.com/RangelReale/inreq-path). +[https://github.com/rrgmc/inreq-path](https://github.com/rrgmc/inreq-path). - name: the path var name to get from `PathValue.GetRequestPath`. Default uses `FieldNameMapper`, which by default uses `strings.ToLower`. - required: whether the path var is required to exist. Default is true. @@ -213,7 +213,7 @@ This tag makes the field be ignored. ## Author -The code is based on my other library, [InStruct](https://github.com/RangelReale/instruct), a generic library for +The code is based on my other library, [InStruct](https://github.com/rrgmc/instruct), a generic library for mapping any data into structs. Rangel Reale (rangelreale@gmail.com) diff --git a/alias.go b/alias.go index 525ee7b..d213712 100644 --- a/alias.go +++ b/alias.go @@ -1,8 +1,8 @@ package inreq import ( - "github.com/RangelReale/instruct" - "github.com/RangelReale/instruct/types" + "github.com/rrgmc/instruct" + "github.com/rrgmc/instruct/types" ) // error.go diff --git a/ctx.go b/ctx.go index 8dd6ccb..961a3b7 100644 --- a/ctx.go +++ b/ctx.go @@ -1,6 +1,6 @@ package inreq -import "github.com/RangelReale/instruct" +import "github.com/rrgmc/instruct" // DecodeContext is the context sent to DecodeOperation. type DecodeContext interface { diff --git a/decode.go b/decode.go index 98206c5..fe64ba1 100644 --- a/decode.go +++ b/decode.go @@ -3,8 +3,8 @@ package inreq import ( "net/http" - "github.com/RangelReale/instruct" - inoptions "github.com/RangelReale/instruct/options" + "github.com/rrgmc/instruct" + inoptions "github.com/rrgmc/instruct/options" ) // Decoder decodes http requests to structs. diff --git a/decode_type.go b/decode_type.go index bc41f0a..f88b610 100644 --- a/decode_type.go +++ b/decode_type.go @@ -3,8 +3,8 @@ package inreq import ( "net/http" - "github.com/RangelReale/instruct" - inoptions "github.com/RangelReale/instruct/options" + "github.com/rrgmc/instruct" + inoptions "github.com/rrgmc/instruct/options" ) // TypeDecoder decodes http requests to structs. diff --git a/example_decode_test.go b/example_decode_test.go index edbd380..c1340aa 100644 --- a/example_decode_test.go +++ b/example_decode_test.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "github.com/RangelReale/inreq" + "github.com/rrgmc/inreq" ) type InputBody struct { @@ -39,7 +39,7 @@ func ExampleDecode() { data := &Input{} err = inreq.Decode(r, data, - // usually this will be a framework-specific implementation, like "github.com/RangelReale/inreq-path/gorillamux". + // usually this will be a framework-specific implementation, like "github.com/rrgmc/inreq-path/gorillamux". inreq.WithPathValue(inreq.PathValueFunc(func(r *http.Request, name string) (found bool, value any, err error) { if name == "deviceid" { return true, "12345", err diff --git a/example_decoder_test.go b/example_decoder_test.go index 4385dc8..aa42c90 100644 --- a/example_decoder_test.go +++ b/example_decoder_test.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "github.com/RangelReale/inreq" + "github.com/rrgmc/inreq" ) type InputDecoderBody struct { @@ -39,7 +39,7 @@ func ExampleNewDecoder() { data := &Input{} decoder := inreq.NewDecoder( - // usually this will be a framework-specific implementation, like "github.com/RangelReale/inreq-path/gorillamux". + // usually this will be a framework-specific implementation, like "github.com/rrgmc/inreq-path/gorillamux". inreq.WithPathValue(inreq.PathValueFunc(func(r *http.Request, name string) (found bool, value any, err error) { if name == "deviceid" { return true, "12345", err diff --git a/example_decodetype_test.go b/example_decodetype_test.go index 6011069..12344f5 100644 --- a/example_decodetype_test.go +++ b/example_decodetype_test.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "github.com/RangelReale/inreq" + "github.com/rrgmc/inreq" ) type InputTypeBody struct { @@ -37,7 +37,7 @@ func ExampleDecodeType() { r.Form.Add("devicename", "form-device-name") data, err := inreq.DecodeType[InputType](r, - // usually this will be a framework-specific implementation, like "github.com/RangelReale/inreq-path/gorillamux". + // usually this will be a framework-specific implementation, like "github.com/rrgmc/inreq-path/gorillamux". inreq.WithPathValue(inreq.PathValueFunc(func(r *http.Request, name string) (found bool, value any, err error) { if name == "deviceid" { return true, "12345", err diff --git a/example_typedecoder_test.go b/example_typedecoder_test.go index 5b5294a..695db03 100644 --- a/example_typedecoder_test.go +++ b/example_typedecoder_test.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "github.com/RangelReale/inreq" + "github.com/rrgmc/inreq" ) type InputTypeDecoderBody struct { @@ -37,7 +37,7 @@ func ExampleNewTypeDecoder() { r.Form.Add("devicename", "form-device-name") decoder := inreq.NewTypeDecoder[InputTypeDecoder]( - // usually this will be a framework-specific implementation, like "github.com/RangelReale/inreq-path/gorillamux". + // usually this will be a framework-specific implementation, like "github.com/rrgmc/inreq-path/gorillamux". inreq.WithPathValue(inreq.PathValueFunc(func(r *http.Request, name string) (found bool, value any, err error) { if name == "deviceid" { return true, "12345", err diff --git a/go.mod b/go.mod index dbfe50b..d5f6345 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ -module github.com/RangelReale/inreq +module github.com/rrgmc/inreq go 1.20 require ( - github.com/RangelReale/instruct v0.17.0 + github.com/rrgmc/instruct v0.17.0 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 ) diff --git a/go.sum b/go.sum index 78a7f6c..609640a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/RangelReale/instruct v0.17.0 h1:+oprPS5QNbgGR6VfdSqfLhJOPAIa2IuSN5vWbr9Odjg= -github.com/RangelReale/instruct v0.17.0/go.mod h1:IKuAbSEzfM7ucw8sMYKLvOj4cVd+wDpaQ0uQj2pYN7w= +github.com/rrgmc/instruct v0.17.0 h1:+oprPS5QNbgGR6VfdSqfLhJOPAIa2IuSN5vWbr9Odjg= +github.com/rrgmc/instruct v0.17.0/go.mod h1:IKuAbSEzfM7ucw8sMYKLvOj4cVd+wDpaQ0uQj2pYN7w= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/operation.go b/operation.go index b5254a7..c06d3c9 100644 --- a/operation.go +++ b/operation.go @@ -3,7 +3,7 @@ package inreq import ( "net/http" - "github.com/RangelReale/instruct" + "github.com/rrgmc/instruct" ) const ( diff --git a/option.go b/option.go index 75b0fc4..2ee8182 100644 --- a/option.go +++ b/option.go @@ -3,8 +3,8 @@ package inreq import ( "net/http" - "github.com/RangelReale/instruct" - "github.com/RangelReale/instruct/options" + "github.com/rrgmc/instruct" + "github.com/rrgmc/instruct/options" ) type ( diff --git a/option_internal.go b/option_internal.go index 4dc2c38..1dcb66b 100644 --- a/option_internal.go +++ b/option_internal.go @@ -3,8 +3,8 @@ package inreq import ( "net/http" - "github.com/RangelReale/instruct" - "github.com/RangelReale/instruct/options" + "github.com/rrgmc/instruct" + "github.com/rrgmc/instruct/options" ) const ( diff --git a/options.go b/options.go index d67a3bb..544358f 100644 --- a/options.go +++ b/options.go @@ -4,7 +4,7 @@ import ( "net/http" "reflect" - "github.com/RangelReale/instruct" + "github.com/rrgmc/instruct" ) // WithTagName sets the tag name to check on structs. The default is "inreq". diff --git a/resolver/resolver.go b/resolver/resolver.go index f89a75f..5a786b4 100644 --- a/resolver/resolver.go +++ b/resolver/resolver.go @@ -1,7 +1,7 @@ package resolver import ( - "github.com/RangelReale/instruct/resolver" + "github.com/rrgmc/instruct/resolver" ) // Resolver is the default Resolver. diff --git a/resolver/resolver_value.go b/resolver/resolver_value.go index fbaa64d..aa0a90e 100644 --- a/resolver/resolver_value.go +++ b/resolver/resolver_value.go @@ -1,7 +1,7 @@ package resolver import ( - "github.com/RangelReale/instruct/resolver" + "github.com/rrgmc/instruct/resolver" ) // ValueResolver resolves simple types for a Resolver.