Skip to content

Commit

Permalink
Обновление для поддержки go mod
Browse files Browse the repository at this point in the history
  • Loading branch information
monoflash committed Jun 26, 2022
1 parent 3087924 commit 88df080
Show file tree
Hide file tree
Showing 71 changed files with 135 additions and 272 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ _obj
_test
src

# IDE
.project
.settings
.idea

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
Expand Down
36 changes: 18 additions & 18 deletions .testpackages
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
gopkg.in/webnice/web.v1
gopkg.in/webnice/web.v1/ambry
gopkg.in/webnice/web.v1/context
gopkg.in/webnice/web.v1/context/errors
gopkg.in/webnice/web.v1/context/handlers
gopkg.in/webnice/web.v1/context/route
gopkg.in/webnice/web.v1/header
gopkg.in/webnice/web.v1/method
gopkg.in/webnice/web.v1/mime
gopkg.in/webnice/web.v1/param
gopkg.in/webnice/web.v1/route
gopkg.in/webnice/web.v1/status
gopkg.in/webnice/web.v1/proxyp
gopkg.in/webnice/web.v1/proxyp/tlvparse
gopkg.in/webnice/web.v1/middleware/recovery
gopkg.in/webnice/web.v1/middleware/pprof
gopkg.in/webnice/web.v1/middleware/nocache
gopkg.in/webnice/web.v1/middleware/contentTypeDefault
github.com/webnice/web
github.com/webnice/web/ambry
github.com/webnice/web/context
github.com/webnice/web/context/errors
github.com/webnice/web/context/handlers
github.com/webnice/web/context/route
github.com/webnice/web/header
github.com/webnice/web/method
github.com/webnice/web/mime
github.com/webnice/web/param
github.com/webnice/web/route
github.com/webnice/web/status
github.com/webnice/web/proxyp
github.com/webnice/web/proxyp/tlvparse
github.com/webnice/web/middleware/recovery
github.com/webnice/web/middleware/pprof
github.com/webnice/web/middleware/nocache
github.com/webnice/web/middleware/contentTypeDefault
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ language: go

install:
- go get github.com/mattn/goveralls
- go get gopkg.in/webnice/debug.v1
- go get gopkg.in/webnice/log.v2
- go get github.com/webnice/debug

script:
- make test
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GO111MODULE ?= $(GO111MODULE:on)
default: help

link:
@mkdir -p src/gopkg.in/webnice; cd src/gopkg.in/webnice && ln -s ../../.. web.v1 2>/dev/null; true
@mkdir -p src/github.com/webnice; cd src/github.com/webnice && ln -s ../../.. web 2>/dev/null; true
.PHONY: link

## Code generation (run only during development)
Expand All @@ -30,7 +30,7 @@ test: link
@echo "mode: set" > coverage.log
@for PACKET in $(TESTPACKETS); do \
touch coverage-tmp.log; \
GOPATH=${GOPATH} go test -v -covermode=count -coverprofile=coverage-tmp.log $$PACKET; \
GO111MODULE="off" go test -v -covermode=count -coverprofile=coverage-tmp.log $$PACKET; \
if [ "$$?" -ne "0" ]; then exit $$?; fi; \
tail -n +2 coverage-tmp.log | sort -r | awk '{if($$1 != last) {print $$0;last=$$1}}' >> coverage.log; \
rm -f coverage-tmp.log; true; \
Expand All @@ -39,7 +39,7 @@ test: link

## Displaying in the browser coverage of tested code, on the html report (run only during development)
cover: test
@GOPATH=${GOPATH} go tool cover -html=$(DIR)/coverage.log
@GOPATH=${GOPATH} GO111MODULE="off" go tool cover -html=$(DIR)/coverage.log
.PHONY: cover

## Performance testing
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# web

[![GoDoc](https://godoc.org/gopkg.in/webnice/web.v1?status.png)](http://godoc.org/gopkg.in/webnice/web.v1)
[![GoDoc](https://godoc.org/github.com/webnice/web?status.png)](http://godoc.org/github.com/webnice/web)
[![Go Report Card](https://goreportcard.com/badge/github.com/webnice/web)](https://goreportcard.com/report/github.com/webnice/web)
[![Coverage Status](https://coveralls.io/repos/github/webnice/web/badge.svg?branch=v1)](https://coveralls.io/github/webnice/web?branch=v1)
[![Build Status](https://travis-ci.org/webnice/web.svg?branch=v1)](https://travis-ci.org/webnice/web)
Expand All @@ -20,5 +20,5 @@ But at the same time framework adds to your application a full-functions routing

#### Install
```bash
go get gopkg.in/webnice/web.v1
go get github.com/webnice/web
```
3 changes: 0 additions & 3 deletions ambry/ambry.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package ambry

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"

// New is a constructor
func New() Interface {
var itm = new(impl)
Expand Down
12 changes: 5 additions & 7 deletions ambry/ambry_bench_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package ambry

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"testing"
)
import "testing"

const KEY = "foo"
const VAL = "bar"
const (
KEY = "foo"
VAL = "bar"
)

var res interface{}

Expand Down
6 changes: 1 addition & 5 deletions ambry/ambry_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package ambry

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"testing"
)
import "testing"

var (
k = `A69F2F4D-0B8F-43D3-8E1B-1EA90766FEB5`
Expand Down
2 changes: 0 additions & 2 deletions ambry/types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package ambry

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import "sync"

// Interface is an interface of package
Expand Down
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
override:
- mkdir -p src/gopkg.in/webnice
- cd src/gopkg.in/webnice && ln -s ../../.. web.v1 2>/dev/null
- mkdir -p src/github.com/webnice
- cd src/github.com/webnice && ln -s ../../.. web 2>/dev/null

test:
override:
Expand Down
10 changes: 2 additions & 8 deletions constants.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package web

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"time"
)
import "time"

const (
shutdownTimeout time.Duration = time.Minute / 2
)
const shutdownTimeout time.Duration = time.Minute / 2
8 changes: 3 additions & 5 deletions context/context.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package context

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
stdContext "context"
"net/http"

"gopkg.in/webnice/web.v1/context/errors"
"gopkg.in/webnice/web.v1/context/handlers"
"gopkg.in/webnice/web.v1/context/route"
"github.com/webnice/web/context/errors"
"github.com/webnice/web/context/handlers"
"github.com/webnice/web/context/route"
)

// New returns a new routing context object
Expand Down
6 changes: 2 additions & 4 deletions context/data.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package context

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"bytes"
"encoding/json"
Expand All @@ -12,8 +10,8 @@ import (
runtimeDebug "runtime/debug"
"strings"

"gopkg.in/webnice/web.v1/header"
"gopkg.in/webnice/web.v1/mime"
"github.com/webnice/web/header"
"github.com/webnice/web/mime"
)

// RegisterGlobalVerifyPlugin Register global external library of data verification
Expand Down
4 changes: 1 addition & 3 deletions context/errors/errors.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package errors

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import "gopkg.in/webnice/web.v1/ambry"
import "github.com/webnice/web/ambry"

// New returns new context object
func New() Interface {
Expand Down
4 changes: 1 addition & 3 deletions context/errors/types.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package errors

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import "gopkg.in/webnice/web.v1/ambry"
import "github.com/webnice/web/ambry"

const (
keyRouteConfigurationError uint32 = iota
Expand Down
8 changes: 3 additions & 5 deletions context/handlers/defaults.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package handlers

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"net/http"

"gopkg.in/webnice/web.v1/header"
"gopkg.in/webnice/web.v1/mime"
"gopkg.in/webnice/web.v1/status"
"github.com/webnice/web/header"
"github.com/webnice/web/mime"
"github.com/webnice/web/status"
)

// Default handler for internal server errors
Expand Down
4 changes: 1 addition & 3 deletions context/handlers/defaults_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package handlers

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"

"gopkg.in/webnice/web.v1/context/errors"
"github.com/webnice/web/context/errors"
)

func testDefaults(t *testing.T, handler http.HandlerFunc, hfName string, response string) {
Expand Down
6 changes: 2 additions & 4 deletions context/handlers/handlers.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package handlers

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"net/http"

"gopkg.in/webnice/web.v1/ambry"
"gopkg.in/webnice/web.v1/context/errors"
"github.com/webnice/web/ambry"
"github.com/webnice/web/context/errors"
)

// New returns new context object
Expand Down
4 changes: 1 addition & 3 deletions context/handlers/handlers_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package handlers

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"fmt"
"net/http"
"testing"

"gopkg.in/webnice/web.v1/context/errors"
"github.com/webnice/web/context/errors"
)

type testHandler struct {
Expand Down
6 changes: 2 additions & 4 deletions context/handlers/types.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package handlers

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"net/http"

"gopkg.in/webnice/web.v1/ambry"
"gopkg.in/webnice/web.v1/context/errors"
"github.com/webnice/web/ambry"
"github.com/webnice/web/context/errors"
)

const (
Expand Down
3 changes: 0 additions & 3 deletions context/key.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package context

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"

// key is a value for use with context.WithValue
// It's used as a pointer so it fits in an interface{} without allocation
type key struct {
Expand Down
4 changes: 1 addition & 3 deletions context/route/route.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package route

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"strings"

"gopkg.in/webnice/web.v1/param"
"github.com/webnice/web/param"
)

// New returns a new routing context object
Expand Down
4 changes: 1 addition & 3 deletions context/route/types.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package route

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import "gopkg.in/webnice/web.v1/param"
import "github.com/webnice/web/param"

// This is the default routing context set on the root node of a request context to track URL parameters and an optional routing path
type impl struct {
Expand Down
8 changes: 3 additions & 5 deletions context/types.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package context

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"net/http"

"gopkg.in/webnice/web.v1/context/errors"
"gopkg.in/webnice/web.v1/context/handlers"
"gopkg.in/webnice/web.v1/context/route"
"github.com/webnice/web/context/errors"
"github.com/webnice/web/context/handlers"
"github.com/webnice/web/context/route"
)

var (
Expand Down
3 changes: 0 additions & 3 deletions errors.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package web

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"

// All errors are defined as constants
const (
cAlreadyRunning = `Web server already running`
Expand Down
2 changes: 0 additions & 2 deletions errors_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package web

//import "gopkg.in/webnice/debug.v1"
//import "gopkg.in/webnice/log.v2"
import (
"strings"
"testing"
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/webnice/web

go 1.18
4 changes: 0 additions & 4 deletions header/header_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
package header

//import (
//
//)
Loading

0 comments on commit 88df080

Please sign in to comment.