Skip to content

Commit 60aeb17

Browse files
authored
Merge pull request #3 from moul/dev/moul/template-post-clone
2 parents 03c8618 + 7f9794d commit 60aeb17

File tree

19 files changed

+287
-332
lines changed

19 files changed

+287
-332
lines changed

.all-contributorsrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030
],
3131
"contributorsPerLine": 7,
32-
"projectName": "golang-repo-template",
32+
"projectName": "chizap",
3333
"projectOwner": "moul",
3434
"repoType": "github",
3535
"repoHost": "https://github.com",

.github/workflows/docker.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.goreleaser.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

AUTHORS

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

COPYRIGHT

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
Copyright 2021 Manfred Touron and other golang-repo-template Developers.
1+
Copyright 2021 Manfred Touron and other chizap Developers.
22

33
Intellectual Property Notice
44
----------------------------
55

6-
golang-repo-template is licensed under the Apache License, Version 2.0
6+
chizap is licensed under the Apache License, Version 2.0
77
(see LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or
88
the MIT license (see LICENSE-MIT or http://opensource.org/licenses/MIT),
99
at your option.
1010

11-
Copyrights and patents in the golang-repo-templates project are retained
11+
Copyrights and patents in the chizaps project are retained
1212
by contributors.
13-
No copyright assignment is required to contribute to golang-repo-template.
13+
No copyright assignment is required to contribute to chizap.
1414

1515
SPDX-License-Identifier: (Apache-2.0 OR MIT)
1616

Dockerfile

Lines changed: 0 additions & 31 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
GOPKG ?= moul.io/golang-repo-template
2-
DOCKER_IMAGE ?= moul/golang-repo-template
3-
GOBINS ?= .
4-
NPM_PACKAGES ?= .
1+
GOPKG ?= moul.io/chizap
52

63
include rules.mk
74

8-
generate: install
5+
generate:
96
GO111MODULE=off go get github.com/campoy/embedmd
107
mkdir -p .tmp
11-
echo 'foo@bar:~$$ golang-repo-template hello world' > .tmp/usage.txt
12-
golang-repo-template hello world 2>&1 >> .tmp/usage.txt
8+
go doc -all > .tmp/godoc.txt
139
embedmd -w README.md
1410
rm -rf .tmp
1511
.PHONY: generate

README.md

Lines changed: 59 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,78 @@
1-
# golang-repo-template
1+
# chizap
22

3-
:smile: golang-repo-template
3+
:smile: chizap
44

5-
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/moul.io/golang-repo-template)
6-
[![License](https://img.shields.io/badge/license-Apache--2.0%20%2F%20MIT-%2397ca00.svg)](https://github.com/moul/golang-repo-template/blob/main/COPYRIGHT)
7-
[![GitHub release](https://img.shields.io/github/release/moul/golang-repo-template.svg)](https://github.com/moul/golang-repo-template/releases)
8-
[![Docker Metrics](https://images.microbadger.com/badges/image/moul/golang-repo-template.svg)](https://microbadger.com/images/moul/golang-repo-template)
5+
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/moul.io/chizap)
6+
[![License](https://img.shields.io/badge/license-Apache--2.0%20%2F%20MIT-%2397ca00.svg)](https://github.com/moul/chizap/blob/main/COPYRIGHT)
7+
[![GitHub release](https://img.shields.io/github/release/moul/chizap.svg)](https://github.com/moul/chizap/releases)
8+
[![Docker Metrics](https://images.microbadger.com/badges/image/moul/chizap.svg)](https://microbadger.com/images/moul/chizap)
99
[![Made by Manfred Touron](https://img.shields.io/badge/made%20by-Manfred%20Touron-blue.svg?style=flat)](https://manfred.life/)
1010

11-
[![Go](https://github.com/moul/golang-repo-template/workflows/Go/badge.svg)](https://github.com/moul/golang-repo-template/actions?query=workflow%3AGo)
12-
[![Release](https://github.com/moul/golang-repo-template/workflows/Release/badge.svg)](https://github.com/moul/golang-repo-template/actions?query=workflow%3ARelease)
13-
[![PR](https://github.com/moul/golang-repo-template/workflows/PR/badge.svg)](https://github.com/moul/golang-repo-template/actions?query=workflow%3APR)
14-
[![GolangCI](https://golangci.com/badges/github.com/moul/golang-repo-template.svg)](https://golangci.com/r/github.com/moul/golang-repo-template)
15-
[![codecov](https://codecov.io/gh/moul/golang-repo-template/branch/main/graph/badge.svg)](https://codecov.io/gh/moul/golang-repo-template)
16-
[![Go Report Card](https://goreportcard.com/badge/moul.io/golang-repo-template)](https://goreportcard.com/report/moul.io/golang-repo-template)
17-
[![CodeFactor](https://www.codefactor.io/repository/github/moul/golang-repo-template/badge)](https://www.codefactor.io/repository/github/moul/golang-repo-template)
18-
19-
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/moul/golang-repo-template)
11+
[![Go](https://github.com/moul/chizap/workflows/Go/badge.svg)](https://github.com/moul/chizap/actions?query=workflow%3AGo)
12+
[![Release](https://github.com/moul/chizap/workflows/Release/badge.svg)](https://github.com/moul/chizap/actions?query=workflow%3ARelease)
13+
[![PR](https://github.com/moul/chizap/workflows/PR/badge.svg)](https://github.com/moul/chizap/actions?query=workflow%3APR)
14+
[![GolangCI](https://golangci.com/badges/github.com/moul/chizap.svg)](https://golangci.com/r/github.com/moul/chizap)
15+
[![codecov](https://codecov.io/gh/moul/chizap/branch/main/graph/badge.svg)](https://codecov.io/gh/moul/chizap)
16+
[![Go Report Card](https://goreportcard.com/badge/moul.io/chizap)](https://goreportcard.com/report/moul.io/chizap)
17+
[![CodeFactor](https://www.codefactor.io/repository/github/moul/chizap/badge)](https://www.codefactor.io/repository/github/moul/chizap)
18+
19+
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/moul/chizap)
20+
21+
## Example
22+
23+
[embedmd]:# (example_test.go /import\ / $)
24+
```go
25+
import (
26+
"github.com/go-chi/chi"
27+
"go.uber.org/zap"
28+
"moul.io/chizap"
29+
)
30+
31+
func Example() {
32+
logger := zap.NewExample()
33+
r := chi.NewRouter()
34+
r.Use(chizap.New(logger, &chizap.Opts{
35+
WithReferer: true,
36+
WithUserAgent: true,
37+
}))
38+
}
39+
```
2040

2141
## Usage
2242

23-
[embedmd]:# (.tmp/usage.txt console)
24-
```console
25-
foo@bar:~$ golang-repo-template hello world
26-
_ _ _ _
27-
__ _ ___ | | __ _ _ _ __ _ ___ _ _ ___ _ __ ___ ___ | |_ ___ _ __ _ __ | | __ _ | |_ ___
28-
/ _` |/ _ \| |/ _` || ' \ / _` ||___|| '_|/ -_)| '_ \/ _ \|___|| _|/ -_)| ' \ | '_ \| |/ _` || _|/ -_)
29-
\__, |\___/|_|\__,_||_||_|\__, | |_| \___|| .__/\___/ \__|\___||_|_|_|| .__/|_|\__,_| \__|\___|
30-
|___/ |___/ |_| |_|
31-
12 CPUs, /home/moul/.gvm/pkgsets/go1.16/global/bin/golang-repo-template, fwrz, go1.16
32-
args ["golang-repo-template","hello","world"]
43+
[embedmd]:# (.tmp/godoc.txt txt /FUNCTIONS/ $)
44+
```txt
45+
FUNCTIONS
46+
47+
func New(logger *zap.Logger, opts *Opts) func(next http.Handler) http.Handler
48+
New returns a logger middleware for chi, that implements the http.Handler
49+
interface.
50+
51+
52+
TYPES
53+
54+
type Opts struct {
55+
// WithReferer enables logging the "Referer" HTTP header value.
56+
WithReferer bool
57+
58+
// WithUserAgent enables logging the "User-Agent" HTTP header value.
59+
WithUserAgent bool
60+
}
61+
Opts contains the middleware configuration.
62+
3363
```
3464

3565
## Install
3666

3767
### Using go
3868

3969
```sh
40-
go get moul.io/golang-repo-template
70+
go get moul.io/chizap
4171
```
4272

4373
### Releases
4474

45-
See https://github.com/moul/golang-repo-template/releases
75+
See https://github.com/moul/chizap/releases
4676

4777
## Contribute
4878

@@ -73,7 +103,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
73103
<!-- markdownlint-disable -->
74104
<table>
75105
<tr>
76-
<td align="center"><a href="http://manfred.life"><img src="https://avatars1.githubusercontent.com/u/94029?v=4" width="100px;" alt=""/><br /><sub><b>Manfred Touron</b></sub></a><br /><a href="#maintenance-moul" title="Maintenance">🚧</a> <a href="https://github.com/moul/golang-repo-template/commits?author=moul" title="Documentation">📖</a> <a href="https://github.com/moul/golang-repo-template/commits?author=moul" title="Tests">⚠️</a> <a href="https://github.com/moul/golang-repo-template/commits?author=moul" title="Code">💻</a></td>
106+
<td align="center"><a href="http://manfred.life"><img src="https://avatars1.githubusercontent.com/u/94029?v=4" width="100px;" alt=""/><br /><sub><b>Manfred Touron</b></sub></a><br /><a href="#maintenance-moul" title="Maintenance">🚧</a> <a href="https://github.com/moul/chizap/commits?author=moul" title="Documentation">📖</a> <a href="https://github.com/moul/chizap/commits?author=moul" title="Tests">⚠️</a> <a href="https://github.com/moul/chizap/commits?author=moul" title="Code">💻</a></td>
77107
<td align="center"><a href="https://manfred.life/moul-bot"><img src="https://avatars1.githubusercontent.com/u/41326314?v=4" width="100px;" alt=""/><br /><sub><b>moul-bot</b></sub></a><br /><a href="#maintenance-moul-bot" title="Maintenance">🚧</a></td>
78108
</tr>
79109
</table>
@@ -87,7 +117,7 @@ specification. Contributions of any kind welcome!
87117

88118
### Stargazers over time
89119

90-
[![Stargazers over time](https://starchart.cc/moul/golang-repo-template.svg)](https://starchart.cc/moul/golang-repo-template)
120+
[![Stargazers over time](https://starchart.cc/moul/chizap.svg)](https://starchart.cc/moul/chizap)
91121

92122
## License
93123

0 commit comments

Comments
 (0)