mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-29 22:36:14 -06:00
go fmt
This commit is contained in:
parent
7e80eafaea
commit
28f89891d6
9 changed files with 47 additions and 47 deletions
|
|
@ -40,18 +40,18 @@ func adminCommands() []*cli.Command {
|
||||||
Usage: "create a new account",
|
Usage: "create a new account",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.UsernameFlag,
|
Name: config.UsernameFlag,
|
||||||
Usage: config.UsernameUsage,
|
Usage: config.UsernameUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.EmailFlag,
|
Name: config.EmailFlag,
|
||||||
Usage: config.EmailUsage,
|
Usage: config.EmailUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.PasswordFlag,
|
Name: config.PasswordFlag,
|
||||||
Usage: config.PasswordUsage,
|
Usage: config.PasswordUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -64,8 +64,8 @@ func adminCommands() []*cli.Command {
|
||||||
Usage: "confirm an existing account manually, thereby skipping email confirmation",
|
Usage: "confirm an existing account manually, thereby skipping email confirmation",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.UsernameFlag,
|
Name: config.UsernameFlag,
|
||||||
Usage: config.UsernameUsage,
|
Usage: config.UsernameUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -78,8 +78,8 @@ func adminCommands() []*cli.Command {
|
||||||
Usage: "promote an account to admin",
|
Usage: "promote an account to admin",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.UsernameFlag,
|
Name: config.UsernameFlag,
|
||||||
Usage: config.UsernameUsage,
|
Usage: config.UsernameUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -92,8 +92,8 @@ func adminCommands() []*cli.Command {
|
||||||
Usage: "demote an account from admin to normal user",
|
Usage: "demote an account from admin to normal user",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.UsernameFlag,
|
Name: config.UsernameFlag,
|
||||||
Usage: config.UsernameUsage,
|
Usage: config.UsernameUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -106,8 +106,8 @@ func adminCommands() []*cli.Command {
|
||||||
Usage: "prevent an account from signing in or posting etc, but don't delete anything",
|
Usage: "prevent an account from signing in or posting etc, but don't delete anything",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.UsernameFlag,
|
Name: config.UsernameFlag,
|
||||||
Usage: config.UsernameUsage,
|
Usage: config.UsernameUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -120,8 +120,8 @@ func adminCommands() []*cli.Command {
|
||||||
Usage: "completely remove an account and all of its posts, media, etc",
|
Usage: "completely remove an account and all of its posts, media, etc",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.UsernameFlag,
|
Name: config.UsernameFlag,
|
||||||
Usage: config.UsernameUsage,
|
Usage: config.UsernameUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -134,13 +134,13 @@ func adminCommands() []*cli.Command {
|
||||||
Usage: "set a new password for the given account",
|
Usage: "set a new password for the given account",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.UsernameFlag,
|
Name: config.UsernameFlag,
|
||||||
Usage: config.UsernameUsage,
|
Usage: config.UsernameUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.PasswordFlag,
|
Name: config.PasswordFlag,
|
||||||
Usage: config.PasswordUsage,
|
Usage: config.PasswordUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -155,8 +155,8 @@ func adminCommands() []*cli.Command {
|
||||||
Usage: "export data from the database to file at the given path",
|
Usage: "export data from the database to file at the given path",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: config.TransPathFlag,
|
Name: config.TransPathFlag,
|
||||||
Usage: config.TransPathUsage,
|
Usage: config.TransPathUsage,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ const (
|
||||||
PasswordFlag = "password"
|
PasswordFlag = "password"
|
||||||
PasswordUsage = "the password to set for this account"
|
PasswordUsage = "the password to set for this account"
|
||||||
|
|
||||||
TransPathFlag = "path"
|
TransPathFlag = "path"
|
||||||
TransPathUsage = "the path of the file to import from/export to"
|
TransPathUsage = "the path of the file to import from/export to"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ type importer struct {
|
||||||
|
|
||||||
func NewImporter(db db.DB, log *logrus.Logger) Importer {
|
func NewImporter(db db.DB, log *logrus.Logger) Importer {
|
||||||
return &importer{
|
return &importer{
|
||||||
db: db,
|
db: db,
|
||||||
log: log,
|
log: log,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ package trans
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type Block struct {
|
type Block struct {
|
||||||
Type TransType `json:"type" bun:"-"`
|
Type TransType `json:"type" bun:"-"`
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
CreatedAt *time.Time `json:"createdAt"`
|
CreatedAt *time.Time `json:"createdAt"`
|
||||||
URI string `json:"uri"`
|
URI string `json:"uri"`
|
||||||
AccountID string `json:"accountId"`
|
AccountID string `json:"accountId"`
|
||||||
TargetAccountID string `json:"targetAccountId"`
|
TargetAccountID string `json:"targetAccountId"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ package trans
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type Follow struct {
|
type Follow struct {
|
||||||
Type TransType `json:"type" bun:"-"`
|
Type TransType `json:"type" bun:"-"`
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
CreatedAt *time.Time `json:"createdAt"`
|
CreatedAt *time.Time `json:"createdAt"`
|
||||||
URI string `json:"uri"`
|
URI string `json:"uri"`
|
||||||
AccountID string `json:"accountId"`
|
AccountID string `json:"accountId"`
|
||||||
TargetAccountID string `json:"targetAccountId"`
|
TargetAccountID string `json:"targetAccountId"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ package trans
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type FollowRequest struct {
|
type FollowRequest struct {
|
||||||
Type TransType `json:"type" bun:"-"`
|
Type TransType `json:"type" bun:"-"`
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
CreatedAt *time.Time `json:"createdAt"`
|
CreatedAt *time.Time `json:"createdAt"`
|
||||||
URI string `json:"uri"`
|
URI string `json:"uri"`
|
||||||
AccountID string `json:"accountId"`
|
AccountID string `json:"accountId"`
|
||||||
TargetAccountID string `json:"targetAccountId"`
|
TargetAccountID string `json:"targetAccountId"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ type Instance struct {
|
||||||
Domain string `json:"domain"`
|
Domain string `json:"domain"`
|
||||||
Title string `json:"title,omitempty" bun:",nullzero"`
|
Title string `json:"title,omitempty" bun:",nullzero"`
|
||||||
URI string `json:"uri"`
|
URI string `json:"uri"`
|
||||||
SuspendedAt *time.Time `json:"suspendedAt,omitempty" bun:",nullzero"`
|
SuspendedAt *time.Time `json:"suspendedAt,omitempty" bun:",nullzero"`
|
||||||
DomainBlockID string `json:"domainBlockID,omitempty" bun:",nullzero"`
|
DomainBlockID string `json:"domainBlockID,omitempty" bun:",nullzero"`
|
||||||
ShortDescription string `json:"shortDescription,omitempty" bun:",nullzero"`
|
ShortDescription string `json:"shortDescription,omitempty" bun:",nullzero"`
|
||||||
Description string `json:"description,omitempty" bun:",nullzero"`
|
Description string `json:"description,omitempty" bun:",nullzero"`
|
||||||
|
|
|
||||||
|
|
@ -29,21 +29,21 @@ type User struct {
|
||||||
Email string `json:"email,omitempty" bun:",nullzero"`
|
Email string `json:"email,omitempty" bun:",nullzero"`
|
||||||
AccountID string `json:"accountID"`
|
AccountID string `json:"accountID"`
|
||||||
EncryptedPassword string `json:"encryptedPassword"`
|
EncryptedPassword string `json:"encryptedPassword"`
|
||||||
CurrentSignInAt *time.Time `json:"currentSignInAt,omitempty" bun:",nullzero"`
|
CurrentSignInAt *time.Time `json:"currentSignInAt,omitempty" bun:",nullzero"`
|
||||||
LastSignInAt *time.Time `json:"lastSignInAt,omitempty" bun:",nullzero"`
|
LastSignInAt *time.Time `json:"lastSignInAt,omitempty" bun:",nullzero"`
|
||||||
InviteID string `json:"inviteID,omitempty" bun:",nullzero"`
|
InviteID string `json:"inviteID,omitempty" bun:",nullzero"`
|
||||||
ChosenLanguages []string `json:"chosenLanguages,omitempty" bun:",nullzero"`
|
ChosenLanguages []string `json:"chosenLanguages,omitempty" bun:",nullzero"`
|
||||||
FilteredLanguages []string `json:"filteredLanguage,omitempty" bun:",nullzero"`
|
FilteredLanguages []string `json:"filteredLanguage,omitempty" bun:",nullzero"`
|
||||||
Locale string `json:"locale" bun:",nullzero"`
|
Locale string `json:"locale" bun:",nullzero"`
|
||||||
LastEmailedAt time.Time `json:"lastEmailedAt,omitempty" bun:",nullzero"`
|
LastEmailedAt time.Time `json:"lastEmailedAt,omitempty" bun:",nullzero"`
|
||||||
ConfirmationToken string `json:"confirmationToken,omitempty" bun:",nullzero"`
|
ConfirmationToken string `json:"confirmationToken,omitempty" bun:",nullzero"`
|
||||||
ConfirmationSentAt *time.Time `json:"confirmationTokenSentAt,omitempty" bun:",nullzero"`
|
ConfirmationSentAt *time.Time `json:"confirmationTokenSentAt,omitempty" bun:",nullzero"`
|
||||||
ConfirmedAt *time.Time `json:"confirmedAt,omitempty" bun:",nullzero"`
|
ConfirmedAt *time.Time `json:"confirmedAt,omitempty" bun:",nullzero"`
|
||||||
UnconfirmedEmail string `json:"unconfirmedEmail,omitempty" bun:",nullzero"`
|
UnconfirmedEmail string `json:"unconfirmedEmail,omitempty" bun:",nullzero"`
|
||||||
Moderator bool `json:"moderator"`
|
Moderator bool `json:"moderator"`
|
||||||
Admin bool `json:"admin"`
|
Admin bool `json:"admin"`
|
||||||
Disabled bool `json:"disabled"`
|
Disabled bool `json:"disabled"`
|
||||||
Approved bool `json:"approved"`
|
Approved bool `json:"approved"`
|
||||||
ResetPasswordToken string `json:"resetPasswordToken,omitempty" bun:",nullzero"`
|
ResetPasswordToken string `json:"resetPasswordToken,omitempty" bun:",nullzero"`
|
||||||
ResetPasswordSentAt *time.Time `json:"resetPasswordSentAt,omitempty" bun:",nullzero"`
|
ResetPasswordSentAt *time.Time `json:"resetPasswordSentAt,omitempty" bun:",nullzero"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ type TransTestSuite struct {
|
||||||
|
|
||||||
func (suite *TransTestSuite) SetupTest() {
|
func (suite *TransTestSuite) SetupTest() {
|
||||||
suite.db = testrig.NewTestDB()
|
suite.db = testrig.NewTestDB()
|
||||||
suite.log = testrig.NewTestLog()
|
suite.log = testrig.NewTestLog()
|
||||||
testrig.StandardDBSetup(suite.db, nil)
|
testrig.StandardDBSetup(suite.db, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue