-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new error collector & improvements for errors * update golangci-lint, microoptimizations, linter fixes * UseTLS10 method * remove dead code * add 1.17 to the test matrix * fix for docstring * split the core package symbols into the subpackages (if feasible)
- Loading branch information
1 parent
b0d5488
commit 52109ee
Showing
73 changed files
with
2,322 additions
and
752 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
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,4 +1,4 @@ | ||
package core | ||
package config | ||
|
||
import ( | ||
"io/ioutil" | ||
|
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,4 +1,4 @@ | ||
package core | ||
package db | ||
|
||
import ( | ||
"database/sql" | ||
|
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package models | ||
|
||
import "time" | ||
|
||
// Account model. | ||
type Account struct { | ||
CreatedAt time.Time | ||
UpdatedAt time.Time | ||
ChannelSettingsHash string `gorm:"column:channel_settings_hash; type:varchar(70)" binding:"max=70"` | ||
Name string `gorm:"column:name; type:varchar(100)" json:"name,omitempty" binding:"max=100"` | ||
Lang string `gorm:"column:lang; type:varchar(2)" json:"lang,omitempty" binding:"max=2"` | ||
Channel uint64 `gorm:"column:channel; not null; unique" json:"channel,omitempty"` | ||
ID int `gorm:"primary_key"` | ||
ConnectionID int `gorm:"column:connection_id" json:"connectionId,omitempty"` | ||
} | ||
|
||
// Accounts list. | ||
type Accounts []Account |
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,17 @@ | ||
package models | ||
|
||
import "time" | ||
|
||
// Connection model. | ||
type Connection struct { | ||
CreatedAt time.Time | ||
UpdatedAt time.Time | ||
Key string `gorm:"column:api_key; type:varchar(100); not null" json:"api_key,omitempty" binding:"required,max=100"` // nolint:lll | ||
URL string `gorm:"column:api_url; type:varchar(255); not null" json:"api_url,omitempty" binding:"required,validateCrmURL,max=255"` // nolint:lll | ||
GateURL string `gorm:"column:mg_url; type:varchar(255); not null;" json:"mg_url,omitempty" binding:"max=255"` | ||
GateToken string `gorm:"column:mg_token; type:varchar(100); not null; unique" json:"mg_token,omitempty" binding:"max=100"` // nolint:lll | ||
ClientID string `gorm:"column:client_id; type:varchar(70); not null; unique" json:"clientId,omitempty"` | ||
Accounts []Account `gorm:"foreignkey:ConnectionID"` | ||
ID int `gorm:"primary_key"` | ||
Active bool `json:"active,omitempty"` | ||
} |
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,24 @@ | ||
package models | ||
|
||
import "time" | ||
|
||
// User model. | ||
type User struct { | ||
CreatedAt time.Time | ||
UpdatedAt time.Time | ||
ExternalID string `gorm:"column:external_id; type:varchar(255); not null; unique"` | ||
UserPhotoURL string `gorm:"column:user_photo_url; type:varchar(255)" binding:"max=255"` | ||
UserPhotoID string `gorm:"column:user_photo_id; type:varchar(100)" binding:"max=100"` | ||
ID int `gorm:"primary_key"` | ||
} | ||
|
||
// TableName will return table name for User | ||
// It will not work if User is not embedded, but mapped as another type | ||
// type MyUser User // will not work | ||
// but | ||
// type MyUser struct { // will work | ||
// User | ||
// } | ||
func (User) TableName() string { | ||
return "mg_user" | ||
} |
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,4 +1,4 @@ | ||
package core | ||
package models | ||
|
||
import ( | ||
"testing" | ||
|
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.