Skip to content

Commit 3e7be60

Browse files
authored
Merge pull request #2 from coderj001/adding_viper_config
Adding viper config
2 parents d8575a6 + 3d98b19 commit 3e7be60

16 files changed

+715
-191
lines changed

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ linters-settings:
111111
sections:
112112
- standard # standard packages
113113
- default # all other imports that do not fall in any group
114-
- prefix(github.com/coderj001/go-wallheven) # internal imports from `go-wallheven`
114+
- prefix(github.com/coderj001/go-wallhaven) # internal imports from `go-wallhaven`
115115
section-separators:
116116
- newLine
117117

@@ -233,7 +233,7 @@ linters-settings:
233233
goimports:
234234
# put imports beginning with prefix after 3rd-party packages;
235235
# it's a comma-separated list of prefixes
236-
local-prefixes: github.com/coderj001/go-wallheven
236+
local-prefixes: github.com/coderj001/go-wallhaven
237237

238238
golint:
239239
# minimal confidence for issues, default is 0.8

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# printed in the help command
66

77
# Name of the current directory
8-
PROJECTNAME="go-wallheven"
8+
PROJECTNAME="go-wallhaven"
99

1010
# List of all Go-files to be processed
1111
GOFILES=$(wildcard *.go)
@@ -40,7 +40,7 @@ help: Makefile
4040

4141
# Will install missing dependencies
4242
.PHONY: install
43-
## `install`: Fetch dependencies needed to run `go-wallheven`
43+
## `install`: Fetch dependencies needed to run `go-wallhaven`
4444
install:
4545
echo " > Getting dependencies..."
4646
go get -v $(get)
@@ -94,14 +94,14 @@ test-suite: lint test
9494

9595
.PHONY: run
9696
## :
97-
## `run`: Run `go-wallheven` in production mode
97+
## `run`: Run `go-wallhaven` in production mode
9898
run: export production_mode=production
9999
run: export __BUILD_MODE__=production
100100
run:
101101
go run main.go $(q)
102102

103103
.PHONY: run-debug
104-
## `run-debug`: Run `go-wallheven` in debug mode
104+
## `run-debug`: Run `go-wallhaven` in debug mode
105105
run-debug: export debug_mode=debug
106106
run-debug: export __BUILD_MODE__=debug
107107
run-debug:
@@ -110,7 +110,7 @@ run-debug:
110110

111111
.PHONY: docker-gen
112112
## :
113-
## `docker-gen`: Create a production docker image for `go-wallheven`
113+
## `docker-gen`: Create a production docker image for `go-wallhaven`
114114
docker-gen:
115115
echo "Building docker image \`$(IMAGE):$(VERSION)\`..."
116116
docker build --rm \
@@ -121,7 +121,7 @@ docker-gen:
121121

122122

123123
.PHONY: docker-debug
124-
## `docker-debug`: Create debug-friendly docker images for `go-wallheven`
124+
## `docker-debug`: Create debug-friendly docker images for `go-wallhaven`
125125
docker-debug:
126126
echo "Building docker image \`$(IMAGE):$(VERSION)\`..."
127127
docker build --rm=false \

README.md

Lines changed: 20 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1-
# go-wallheven
1+
# go-wallhaven
22

33
<div align="center">
44

5-
[![Build Status](https://img.shields.io/github/checks-status/coderj001/go-wallheven/main?color=black&style=for-the-badge&logo=github)][github-actions]
6-
[![Code Coverage](https://img.shields.io/codecov/c/github/coderj001/go-wallheven?color=blue&logo=codecov&style=for-the-badge)][github-actions-tests]
5+
[![Build Status](https://img.shields.io/github/checks-status/coderj001/go-wallhaven/main?color=black&style=for-the-badge&logo=github)][github-actions]
6+
[![Code Coverage](https://img.shields.io/codecov/c/github/coderj001/go-wallhaven?color=blue&logo=codecov&style=for-the-badge)][github-actions-tests]
77
[![Security: bandit](https://img.shields.io/badge/Security-GoSec-lightgrey?style=for-the-badge&logo=springsecurity)](https://github.com/securego/gosec)
88
[![Dependencies Status](https://img.shields.io/badge/Dependencies-Up%20to%20Date-brightgreen?style=for-the-badge&logo=dependabot)][dependabot-pulls]
99
[![Semantic Versioning](https://img.shields.io/badge/versioning-semantic-black?style=for-the-badge&logo=semver)][github-releases]
1010
[![Pre-Commit Enabled](https://img.shields.io/badge/Pre--Commit-Enabled-blue?style=for-the-badge&logo=pre-commit)][precommit-config]
11-
[![License](https://img.shields.io/github/license/coderj001/go-wallheven?color=red&style=for-the-badge)][project-license]
11+
[![License](https://img.shields.io/github/license/coderj001/go-wallhaven?color=red&style=for-the-badge)][project-license]
1212
[![Go v1.18](https://img.shields.io/badge/Go-%20v1.18-black?style=for-the-badge&logo=go)][gomod-file]
1313

14-
GoWallheven is a Go application created using https://github.com/notsatan/go-template
15-
1614
</div>
1715

1816

1917
## Initial Setup
2018

2119
This section is intended to help developers and contributors get a working copy of
22-
`go-wallheven` on their end
20+
`go-wallhaven` on their end
2321

2422
<details>
2523
<summary>
2624
1. Clone this repository
2725
</summary><br>
2826

2927
```sh
30-
git clone https://github.com/coderj001/go-wallheven
31-
cd go-wallheven
28+
git clone https://github.com/coderj001/go-wallhaven
29+
cd go-wallhaven
3230
```
3331
</details>
3432

@@ -44,18 +42,18 @@ Install `golangci-lint` from the [official website][golangci-install] for your O
4442

4543
## Local Development
4644

47-
This section will guide you to setup a fully-functional local copy of `go-wallheven`
45+
This section will guide you to setup a fully-functional local copy of `go-wallhaven`
4846
on your end and teach you how to use it! Make sure you have installed
4947
[golangci-lint][golangci-install] before following this section!
5048

5149
**Note:** This section relies on the usage of [Makefile][makefile-official]. If you
5250
can't (or don't) use Makefile, you can follow along by running the internal commands
53-
from [`go-wallheven's` Makefile][makefile-file] (most of which are
51+
from [`go-wallhaven's` Makefile][makefile-file] (most of which are
5452
OS-independent)!
5553

5654
### Installing dependencies
5755

58-
To install all dependencies associated with `go-wallheven`, run the
56+
To install all dependencies associated with `go-wallhaven`, run the
5957
command
6058

6159
```sh
@@ -87,7 +85,7 @@ make lint
8785

8886
### Running Tests
8987

90-
Tests in `go-wallheven` are classified as *fast* and *slow* - depending
88+
Tests in `go-wallhaven` are classified as *fast* and *slow* - depending
9189
on how quick they are to execute.
9290

9391
To selectively run tests from either test group, use the Makefile command
@@ -142,9 +140,9 @@ and [all tests](#running-tests) one after the other!
142140
| `fast-tests` | Selectively run *fast* tests | NA |
143141
| `slow-tests` | Selectively run *slow* tests | NA |
144142
| `test-suite` | Check codestyle, run linters and **all** tests | golangci-lint |
145-
| `run` | Run *go-wallheven* | NA |
146-
| `docker-gen` | Create production docker image for *go-wallheven* | docker |
147-
| `docker-debug` | Create debug-friendly docker image for *go-wallheven* | docker |
143+
| `run` | Run *go-wallhaven* | NA |
144+
| `docker-gen` | Create production docker image for *go-wallhaven* | docker |
145+
| `docker-debug` | Create debug-friendly docker image for *go-wallhaven* | docker |
148146
| `clean-docker` | Remove docker image generated by `docker-gen` | docker |
149147

150148
<br>
@@ -181,7 +179,7 @@ directory inside the project directory.
181179
The binaries generated will be named in the format
182180

183181
```text
184-
go-wallheven_<version>_<target-os>_<architecture>.<extension>
182+
go-wallhaven_<version>_<target-os>_<architecture>.<extension>
185183
```
186184

187185
The `<extension>` is optional. By default, `version` is an empty string. A custom
@@ -194,7 +192,7 @@ bash build-script.sh v1.2.1
194192
An example of the files generated by the previous command will be;
195193

196194
```sh
197-
go-wallheven_v1.2.1_windows_x86_64.exe
195+
go-wallhaven_v1.2.1_windows_x86_64.exe
198196
```
199197

200198
### Setting up Codecov
@@ -217,12 +215,12 @@ after the next run of CI pipeline!
217215

218216
### Using Docker
219217

220-
To run `go-wallheven` in a docker container, read the instructions in
218+
To run `go-wallhaven` in a docker container, read the instructions in
221219
[docker section](./docker).
222220

223-
### Running `go-wallheven`
221+
### Running `go-wallhaven`
224222

225-
To run go-wallheven, use the command
223+
To run go-wallhaven, use the command
226224

227225
```sh
228226
make run
@@ -302,41 +300,4 @@ for repositories. [Dependabot][dependabot-link] will implicitly create the
302300
`dependencies` label with the first pull request raised by it.
303301

304302
The remaining labels can be created as needed!
305-
<br>
306-
307-
308-
## Credits
309-
310-
<div align="center"><br>
311-
312-
`go-wallheven` is powered by a template generated using [`go-template`][go-template-link]
313-
314-
[![go-template](https://img.shields.io/badge/go--template-black?style=for-the-badge&logo=go)][go-template-link]
315-
316-
</div>
317-
318-
[makefile-file]: ./Makefile
319-
[project-license]: ./LICENSE
320-
[github-actions]: ../../actions
321-
[github-releases]: ../../releases
322-
[precommit-config]: ./.pre-commit-config.yaml
323-
[gomod-file]: ../main/go.mod
324-
[github-actions-tests]: ../../actions/workflows/tests.yml
325-
[dependabot-pulls]: ../../pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot
326-
327-
[semver-link]: https://semver.org
328-
[pre-commit]: https://pre-commit.com
329-
[github-repo]: https://github.com/new
330-
[gitlab-repo]: https://gitlab.com/new
331-
[dependabot-link]: https://dependabot.com
332-
[githooks]: https://git-scm.com/docs/githooks
333-
[python-install]: https://www.python.org/downloads
334-
[release-drafter-config]: ./.github/release-drafter.yml
335-
[makefile-official]: https://www.gnu.org/software/make
336-
[pip-install]: https://pip.pypa.io/en/stable/installation
337-
[codecov-docs]: https://docs.codecov.com/docs#basic-usage
338-
[go-template-link]: https://github.com/notsatan/go-template
339-
[golangci-install]: https://golangci-lint.run/usage/install
340-
[cookiecutter-link]: https://github.com/cookiecutter/cookiecutter
341-
[release-drafter]: https://github.com/marketplace/actions/release-drafter
342-
[creating-secrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository
303+
<br>

build-script.sh

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bin_path="./bin"
1010
checksums="checksums.txt"
1111

1212
# Basename for the generated binaries - name of the project for example
13-
basename="go-wallheven"
13+
basename="go-wallhaven"
1414

1515
# Release version - can be blank if needed; if blank, will be populated by command-line
1616
# arguments passed while running this script (if any).
@@ -93,41 +93,41 @@ done
9393
echo -e ": Done"
9494
echo -ne "Archiving Binaries"
9595

96-
cd "${bin_path}" || exit # Exit if `cd` fails
97-
98-
# Zip the windows executables
99-
if ! command -v zip >/dev/null; then
100-
echo -e "\tZip not found, unable to generate archives for Windows executables"
101-
else
102-
103-
# Iterating through each executable file - to generate individual `.zip` files
104-
for file in "${file_name}"**".exe"; do
105-
zip_name="${file//.exe/}" # form name of the zip file - remove `.exe`
106-
107-
# Create a zip container for the file, the `-m` flag deletes the original file
108-
zip "${zip_name}.zip" "${file}" -q -m
109-
done
110-
fi
111-
112-
# Run GZip on Linux/Mac binaries
113-
if ! command -v gzip >/dev/null; then
114-
echo -e "\tGZip not found, unable to generate archives"
115-
else
116-
for file in "${file_name}"**; do
117-
if [[ "${file}" == "${file_name}"**".zip" ]]; then
118-
# Skip iteration over zip files
119-
continue
120-
fi
121-
122-
gzip "${file}" -q
123-
done
124-
fi
125-
126-
# Add these checksums to the text file as well
127-
echo "" >>"${checksums}" # append new line
128-
for file in "${file_name}"**; do
129-
sha256sum "$file" >>"${checksums}"
130-
done
131-
132-
echo -e ": Done"
133-
echo -e "\nExecution completed successfully \nBinaries stored in: \"${bin_path}\" \n"
96+
# cd "${bin_path}" || exit # Exit if `cd` fails
97+
98+
# # Zip the windows executables
99+
# if ! command -v zip >/dev/null; then
100+
# echo -e "\tZip not found, unable to generate archives for Windows executables"
101+
# else
102+
103+
# # Iterating through each executable file - to generate individual `.zip` files
104+
# for file in "${file_name}"**".exe"; do
105+
# zip_name="${file//.exe/}" # form name of the zip file - remove `.exe`
106+
107+
# # Create a zip container for the file, the `-m` flag deletes the original file
108+
# zip "${zip_name}.zip" "${file}" -q -m
109+
# done
110+
# fi
111+
112+
# # Run GZip on Linux/Mac binaries
113+
# if ! command -v gzip >/dev/null; then
114+
# echo -e "\tGZip not found, unable to generate archives"
115+
# else
116+
# for file in "${file_name}"**; do
117+
# if [[ "${file}" == "${file_name}"**".zip" ]]; then
118+
# # Skip iteration over zip files
119+
# continue
120+
# fi
121+
122+
# gzip "${file}" -q
123+
# done
124+
# fi
125+
126+
# # Add these checksums to the text file as well
127+
# echo "" >>"${checksums}" # append new line
128+
# for file in "${file_name}"**; do
129+
# sha256sum "$file" >>"${checksums}"
130+
# done
131+
132+
# echo -e ": Done"
133+
# echo -e "\nExecution completed successfully \nBinaries stored in: \"${bin_path}\" \n"

checksums.txt

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

cookiecutter-config-file.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# https://github.com/notsatan/go-template
33

44
cookiecutter_inputs:
5-
project_name: "go-wallheven"
6-
go_module_path: "github.com/coderj001/go-wallheven"
5+
project_name: "go-wallhaven"
6+
go_module_path: "github.com/coderj001/go-wallhaven"
77
license_owner: "example"
88
base_branch: "main"
99
contact_email: "[email protected]"

docker/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ENV GO111MODULE=on \
2424
GOARCH=amd64
2525

2626
# Create a build directory if one does not exist, and use it as the work directory
27-
WORKDIR "/src/__go-wallheven__"
27+
WORKDIR "/src/__go-wallhaven__"
2828

2929
# Selectively copy the requirements into the image - using `*go.sum` prevents failure
3030
# if the file does not exist!
@@ -37,7 +37,7 @@ RUN go mod download
3737
COPY . .
3838

3939
# Generate a binary -- custom name to avoid collisions with existing files/directories
40-
RUN go build -v -o "../__go-wallheven_build_output__"
40+
RUN go build -v -o "../__go-wallhaven_build_output__"
4141

4242

4343
# Second stage - `scratch` for production builds, `golang:1.18` for debug builds
@@ -46,8 +46,8 @@ FROM ${final_image}
4646
WORKDIR "/builds"
4747

4848
# Copy generated binary from previous image to this one - rename for readability
49-
COPY --from=builder "/src/__go-wallheven_build_output__" \
50-
"./go-wallheven"
49+
COPY --from=builder "/src/__go-wallhaven_build_output__" \
50+
"./go-wallhaven"
5151

5252
# Set environment variables to distuinguish between build modes
5353
ARG build_mode=production
@@ -57,4 +57,4 @@ ENV ${build_mode}_mode=${build_mode}
5757

5858

5959
# Run the binary
60-
CMD ["./go-wallheven"]
60+
CMD ["./go-wallhaven"]

0 commit comments

Comments
 (0)