mirror of
https://github.com/pushbits/server.git
synced 2025-08-06 10:08:55 +02:00
Fix linting errors
This commit is contained in:
parent
27c65921d9
commit
628d96bdb7
5 changed files with 6 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
app
|
out/
|
||||||
*.db
|
*.db
|
||||||
config.yml
|
config.yml
|
||||||
|
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -2,7 +2,8 @@ IMAGE := eikendev/pushbits
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
go build -ldflags="-w -s" -o app ./cmd/pushbits
|
mkdir -p ./out
|
||||||
|
go build -ldflags="-w -s" -o ./out/pushbits ./cmd/pushbits
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
|
|
|
@ -47,7 +47,7 @@ func main() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
dp, err := dispatcher.Create(db, c.Matrix.Homeserver, c.Matrix.Username, c.Matrix.Password, c.Formatting)
|
dp, err := dispatcher.Create(c.Matrix.Homeserver, c.Matrix.Username, c.Matrix.Password, c.Formatting)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ func (m *Manager) CreatePasswordHash(password string) ([]byte, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []byte{}, errors.New("HIBP is not available, please wait until service is available again")
|
return []byte{}, errors.New("HIBP is not available, please wait until service is available again")
|
||||||
} else if pwned {
|
} else if pwned {
|
||||||
return []byte{}, errors.New("Password is pwned, please choose another one")
|
return []byte{}, errors.New("password is pwned, please choose another one")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,19 +11,14 @@ var (
|
||||||
loginType = "m.login.password"
|
loginType = "m.login.password"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The Database interface for encapsulating database access.
|
|
||||||
type Database interface {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dispatcher holds information for sending notifications to clients.
|
// Dispatcher holds information for sending notifications to clients.
|
||||||
type Dispatcher struct {
|
type Dispatcher struct {
|
||||||
db Database
|
|
||||||
client *gomatrix.Client
|
client *gomatrix.Client
|
||||||
formatting configuration.Formatting
|
formatting configuration.Formatting
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create instanciates a dispatcher connection.
|
// Create instanciates a dispatcher connection.
|
||||||
func Create(db Database, homeserver, username, password string, formatting configuration.Formatting) (*Dispatcher, error) {
|
func Create(homeserver, username, password string, formatting configuration.Formatting) (*Dispatcher, error) {
|
||||||
log.Println("Setting up dispatcher.")
|
log.Println("Setting up dispatcher.")
|
||||||
|
|
||||||
client, err := gomatrix.NewClient(homeserver, "", "")
|
client, err := gomatrix.NewClient(homeserver, "", "")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue