-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from bro-n-bro/126-add-bostrom
126 add bostrom
- Loading branch information
Showing
177 changed files
with
2,702 additions
and
1,279 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,6 @@ | |
vendor/ | ||
.idea/ | ||
volumes/ | ||
.env.local | ||
.env.local | ||
tmp | ||
bin |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,9 @@ race: dep ## Run data race detector | |
@go test -race ./... -count=1 | ||
|
||
install-linter: ## Install golangci-lint | ||
@go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
@mkdir -p bin | ||
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b bin v1.55.2 | ||
@bin/golangci-lint --version | ||
|
||
lint: install-linter ## Lint the files | ||
./scripts/golint.sh | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package model | ||
|
||
import "time" | ||
|
||
type Tx struct { | ||
Created time.Time | ||
ErrorMessage string `bson:"error_message"` | ||
Hash string `bson:"hash"` | ||
Height int64 `bson:"height"` | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package storage | ||
|
||
import ( | ||
"context" | ||
|
||
"go.mongodb.org/mongo-driver/bson" | ||
|
||
"github.com/bro-n-bro/spacebox-crawler/adapter/storage/model" | ||
) | ||
|
||
func (s *Storage) InsertErrorTx(ctx context.Context, tx model.Tx) error { | ||
if _, err := s.txCollection.InsertOne(ctx, tx); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (s *Storage) CountErrorTxs(ctx context.Context) (int64, error) { | ||
return s.txCollection.CountDocuments(ctx, bson.D{}) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package grpc | ||
|
||
type Config struct { | ||
Host string `env:"GRPC_URL" envDefault:"http://localhost:9090"` | ||
SecureConnection bool `env:"GRPC_SECURE_CONNECTION" envDefault:"false"` | ||
MetricsEnabled bool `env:"METRICS_ENABLED" envDefault:"false"` | ||
} | ||
import "time" | ||
|
||
type ( | ||
Config struct { | ||
Host string `env:"GRPC_URL" envDefault:"http://localhost:9090"` | ||
SecureConnection bool `env:"GRPC_SECURE_CONNECTION" envDefault:"false"` | ||
MetricsEnabled bool `env:"METRICS_ENABLED" envDefault:"false"` | ||
Timeout time.Duration `env:"GRPC_TIMEOUT" envDefault:"15s"` | ||
} | ||
) |
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
Oops, something went wrong.