forked from XiongminLin/mini-spider-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jacksontong
committed
May 23, 2022
1 parent
e7d8836
commit 9688c5c
Showing
37 changed files
with
413 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
# OSX leaves these everywhere on SMB shares | ||
._* | ||
|
||
# OSX trash | ||
.DS_Store | ||
|
||
# Eclipse files | ||
.classpath | ||
.project | ||
.settings/** | ||
|
||
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA | ||
.idea/ | ||
*.iml | ||
.bin/ | ||
|
||
# Vscode files | ||
.vscode | ||
|
||
# This is where the result of the go build goes | ||
/output*/ | ||
/_output*/ | ||
/_output | ||
|
||
# Emacs save files | ||
*~ | ||
\#*\# | ||
.\#* | ||
|
||
# Vim-related files | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
*.un~ | ||
Session.vim | ||
.netrwhist | ||
|
||
# Generate by makefile | ||
bin | ||
node_modules | ||
package.json | ||
yarn.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# init project path | ||
HOMEDIR := $(shell pwd) | ||
OUTDIR := $(HOMEDIR)/output | ||
BIN := mini_spider | ||
|
||
VERSION=`git describe --always` | ||
BUILDTIME=`date +%FT%T%z` | ||
GOVERSION=`go version` | ||
|
||
# init command params | ||
GO := go | ||
GOOS := linux | ||
GOBUILD := $(GO) build | ||
GOTEST := $(GO) test | ||
GOPKGS := $$($(GO) list ./pkg... | grep -vE "vendor") | ||
|
||
# Setup the -ldflags option for go build here, interpolate the variable values | ||
LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION} -X 'main.BuildTime=${BUILDTIME}' -X 'main.GoVersion=${GOVERSION}'" | ||
|
||
# make, make all | ||
all: prepare compile package | ||
|
||
# make prepare | ||
prepare: | ||
|
||
# make compile, go build | ||
compile: build | ||
build: | ||
GOOS=$(GOOS) $(GOBUILD) ${LDFLAGS} -o $(HOMEDIR)/$(BIN) cmd/mini_spider.go | ||
|
||
# make test, test your code | ||
test: test-case | ||
test-case: | ||
$(GOTEST) -v -cover $(GOPKGS) | ||
rm -r test/webpage | ||
|
||
# make package | ||
package: package-bin | ||
package-bin: | ||
mkdir -p $(OUTDIR) | ||
mv $(HOMEDIR)/$(BIN) $(OUTDIR)/ | ||
|
||
# make clean | ||
clean: | ||
rm -rf $(OUTDIR) | ||
|
||
# avoid filename conflict and speed up build | ||
.PHONY: all prepare compile test package clean build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module github.com/cumirror/mini-spider | ||
|
||
go 1.18 | ||
|
||
require ( | ||
github.com/baidu/go-lib v0.0.0-20210902034828-42829d4bdecd | ||
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 | ||
gopkg.in/gcfg.v1 v1.2.3 | ||
) | ||
|
||
require ( | ||
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect | ||
gopkg.in/warnings.v0 v0.1.2 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
github.com/baidu/go-lib v0.0.0-20210902034828-42829d4bdecd h1:AQ/hNi9wwj7mm06Zwycxp++X3cKKMAz8mxjNYSIaj8U= | ||
github.com/baidu/go-lib v0.0.0-20210902034828-42829d4bdecd/go.mod h1:FneHDqz3wLeDGdWfRyW4CzBbCwaqesLGIFb09N80/ww= | ||
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= | ||
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= | ||
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= | ||
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= | ||
gopkg.in/gcfg.v1 v1.2.3 h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs= | ||
gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= | ||
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= | ||
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ modification history | |
DESCRIPTION | ||
*/ | ||
|
||
package mini_spider_config | ||
package config | ||
|
||
import ( | ||
"fmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.