Skip to content

Commit

Permalink
fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
alantong committed Dec 6, 2018
1 parent 6ad265f commit 121a7d8
Show file tree
Hide file tree
Showing 11 changed files with 789 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"strconv"

"github.com/google/go-querystring/query"
"github.com/tencentyun/go-httpheader"
"github.com/mozillazg/go-httpheader"
)

const (
Expand Down
7 changes: 7 additions & 0 deletions vendor/go-httpheader/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[bumpversion]
commit = True
tag = True
current_version = 0.2.0

[bumpversion:file:encode.go]

27 changes: 27 additions & 0 deletions vendor/go-httpheader/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof
dist/
cover.html
cover.out
25 changes: 25 additions & 0 deletions vendor/go-httpheader/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: go
go:
- 1.6
- 1.7
- 1.8
- tip

sudo: false

before_install:
- go get github.com/mattn/goveralls

install:
- go get
- go build

script:
- make test
- $HOME/gopath/bin/goveralls -service=travis-ci -ignore=vendor/

matrix:
allow_failures:
- go: 1.6
- go: 1.7
- go: tip
10 changes: 10 additions & 0 deletions vendor/go-httpheader/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

## 0.2.0 (2017-06-24)

* support http.Header field.


## 0.1.0 (2017-06-10)

* Initial Release
21 changes: 21 additions & 0 deletions vendor/go-httpheader/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 mozillazg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions vendor/go-httpheader/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
help:
@echo "test run test"
@echo "lint run lint"

.PHONY: test
test:
go test -v -cover -coverprofile cover.out
go tool cover -html=cover.out -o cover.html

.PHONY: lint
lint:
gofmt -s -w .
goimports -w .
golint .
go vet
59 changes: 59 additions & 0 deletions vendor/go-httpheader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# go-httpheader

go-httpheader is a Go library for encoding structs into Header fields.


## install

`go get -u github.com/tencentyun/go-httpheader`


## usage

```go
package main

import (
"fmt"
"net/http"

"github.com/tencentyun/go-httpheader"
)

type Options struct {
hide string
ContentType string `header:"Content-Type"`
Length int
XArray []string `header:"X-Array"`
TestHide string `header:"-"`
IgnoreEmpty string `header:"X-Empty,omitempty"`
IgnoreEmptyN string `header:"X-Empty-N,omitempty"`
CustomHeader http.Header
}

func main() {
opt := Options{
hide: "hide",
ContentType: "application/json",
Length: 2,
XArray: []string{"test1", "test2"},
TestHide: "hide",
IgnoreEmptyN: "n",
CustomHeader: http.Header{
"X-Test-1": []string{"233"},
"X-Test-2": []string{"666"},
},
}
h, _ := httpheader.Header(opt)
fmt.Printf("%#v", h)
// h:
// http.Header{
// "X-Test-1": []string{"233"},
// "X-Test-2": []string{"666"},
// "Content-Type": []string{"application/json"},
// "Length": []string{"2"},
// "X-Array": []string{"test1", "test2"},
// "X-Empty-N": []string{"n"},
//}
}
```

0 comments on commit 121a7d8

Please sign in to comment.