You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-08-06 22:32:51 +02:00
gofmt -s
This commit is contained in:
@ -502,7 +502,7 @@ environment docker-compose file without "sample" prepending the file name.
|
|||||||
Navigate to the root of the project. Copy `configs/sample.env_docker_compose` to `.env_docker_compose`.
|
Navigate to the root of the project. Copy `configs/sample.env_docker_compose` to `.env_docker_compose`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd $GOPATH/src/geeks-accelerator/oss/saas-starter-kit
|
$ cd ./saas-starter-kit
|
||||||
$ cp configs/sample.env_docker_compose configs/.env_docker_compose
|
$ cp configs/sample.env_docker_compose configs/.env_docker_compose
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ func NewConfig(log *log.Logger, targetEnv Env, awsCredentials devdeploy.AwsCrede
|
|||||||
LocationConstraint: &cfg.AwsCredentials.Region,
|
LocationConstraint: &cfg.AwsCredentials.Region,
|
||||||
LifecycleRules: []*s3.LifecycleRule{bucketLifecycleTempRule},
|
LifecycleRules: []*s3.LifecycleRule{bucketLifecycleTempRule},
|
||||||
CORSRules: []*s3.CORSRule{
|
CORSRules: []*s3.CORSRule{
|
||||||
&s3.CORSRule{
|
{
|
||||||
// Headers that are specified in the Access-Control-Request-Headers header.
|
// Headers that are specified in the Access-Control-Request-Headers header.
|
||||||
// These headers are allowed in a preflight OPTIONS request. In response to
|
// These headers are allowed in a preflight OPTIONS request. In response to
|
||||||
// any preflight OPTIONS request, Amazon S3 returns any requested headers that
|
// any preflight OPTIONS request, Amazon S3 returns any requested headers that
|
||||||
@ -348,7 +348,7 @@ func NewConfig(log *log.Logger, targetEnv Env, awsCredentials devdeploy.AwsCrede
|
|||||||
AutoMinorVersionUpgrade: aws.Bool(true),
|
AutoMinorVersionUpgrade: aws.Bool(true),
|
||||||
SnapshotRetentionLimit: aws.Int64(7),
|
SnapshotRetentionLimit: aws.Int64(7),
|
||||||
ParameterNameValues: []devdeploy.AwsElasticCacheParameter{
|
ParameterNameValues: []devdeploy.AwsElasticCacheParameter{
|
||||||
devdeploy.AwsElasticCacheParameter{
|
{
|
||||||
ParameterName: "maxmemory-policy",
|
ParameterName: "maxmemory-policy",
|
||||||
ParameterValue: "allkeys-lru",
|
ParameterValue: "allkeys-lru",
|
||||||
},
|
},
|
||||||
|
@ -273,7 +273,7 @@ func NewService(log *log.Logger, serviceName string, cfg *devdeploy.Config) (*de
|
|||||||
|
|
||||||
// Define the target group for service to receive HTTP traffic from the load balancer.
|
// Define the target group for service to receive HTTP traffic from the load balancer.
|
||||||
srv.AwsElbLoadBalancer.TargetGroups = []*devdeploy.AwsElbTargetGroup{
|
srv.AwsElbLoadBalancer.TargetGroups = []*devdeploy.AwsElbTargetGroup{
|
||||||
&devdeploy.AwsElbTargetGroup{
|
{
|
||||||
Name: fmt.Sprintf("%s-http", ctx.Name),
|
Name: fmt.Sprintf("%s-http", ctx.Name),
|
||||||
Port: 80,
|
Port: 80,
|
||||||
Protocol: "HTTP",
|
Protocol: "HTTP",
|
||||||
@ -439,10 +439,10 @@ func NewService(log *log.Logger, serviceName string, cfg *devdeploy.Config) (*de
|
|||||||
Image: aws.String(srv.ReleaseImage),
|
Image: aws.String(srv.ReleaseImage),
|
||||||
Essential: aws.Bool(true),
|
Essential: aws.Bool(true),
|
||||||
PortMappings: []*ecs.PortMapping{
|
PortMappings: []*ecs.PortMapping{
|
||||||
&ecs.PortMapping{
|
{
|
||||||
ContainerPort: aws.Int64(8125),
|
ContainerPort: aws.Int64(8125),
|
||||||
},
|
},
|
||||||
&ecs.PortMapping{
|
{
|
||||||
ContainerPort: aws.Int64(8126),
|
ContainerPort: aws.Int64(8126),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -529,7 +529,7 @@ func NewService(log *log.Logger, serviceName string, cfg *devdeploy.Config) (*de
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
PortMappings: []*ecs.PortMapping{
|
PortMappings: []*ecs.PortMapping{
|
||||||
&ecs.PortMapping{
|
{
|
||||||
HostPort: aws.Int64(80),
|
HostPort: aws.Int64(80),
|
||||||
Protocol: aws.String("tcp"),
|
Protocol: aws.String("tcp"),
|
||||||
ContainerPort: aws.Int64(80),
|
ContainerPort: aws.Int64(80),
|
||||||
@ -549,7 +549,7 @@ func NewService(log *log.Logger, serviceName string, cfg *devdeploy.Config) (*de
|
|||||||
StartPeriod: aws.Int64(60),
|
StartPeriod: aws.Int64(60),
|
||||||
},
|
},
|
||||||
Ulimits: []*ecs.Ulimit{
|
Ulimits: []*ecs.Ulimit{
|
||||||
&ecs.Ulimit{
|
{
|
||||||
Name: aws.String("nofile"),
|
Name: aws.String("nofile"),
|
||||||
SoftLimit: aws.Int64(987654),
|
SoftLimit: aws.Int64(987654),
|
||||||
HardLimit: aws.Int64(999999),
|
HardLimit: aws.Int64(999999),
|
||||||
@ -646,7 +646,7 @@ func NewService(log *log.Logger, serviceName string, cfg *devdeploy.Config) (*de
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
PortMappings: []*ecs.PortMapping{
|
PortMappings: []*ecs.PortMapping{
|
||||||
&ecs.PortMapping{
|
{
|
||||||
HostPort: aws.Int64(80),
|
HostPort: aws.Int64(80),
|
||||||
Protocol: aws.String("tcp"),
|
Protocol: aws.String("tcp"),
|
||||||
ContainerPort: aws.Int64(80),
|
ContainerPort: aws.Int64(80),
|
||||||
@ -666,7 +666,7 @@ func NewService(log *log.Logger, serviceName string, cfg *devdeploy.Config) (*de
|
|||||||
StartPeriod: aws.Int64(60),
|
StartPeriod: aws.Int64(60),
|
||||||
},
|
},
|
||||||
Ulimits: []*ecs.Ulimit{
|
Ulimits: []*ecs.Ulimit{
|
||||||
&ecs.Ulimit{
|
{
|
||||||
Name: aws.String("nofile"),
|
Name: aws.String("nofile"),
|
||||||
SoftLimit: aws.Int64(987654),
|
SoftLimit: aws.Int64(987654),
|
||||||
HardLimit: aws.Int64(999999),
|
HardLimit: aws.Int64(999999),
|
||||||
|
@ -60,11 +60,11 @@ func (h *Checklists) Index(ctx context.Context, w http.ResponseWriter, r *http.R
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields := []datatable.DisplayField{
|
fields := []datatable.DisplayField{
|
||||||
datatable.DisplayField{Field: "id", Title: "ID", Visible: false, Searchable: true, Orderable: true, Filterable: false},
|
{Field: "id", Title: "ID", Visible: false, Searchable: true, Orderable: true, Filterable: false},
|
||||||
datatable.DisplayField{Field: "name", Title: "Checklist", Visible: true, Searchable: true, Orderable: true, Filterable: true, FilterPlaceholder: "filter Name"},
|
{Field: "name", Title: "Checklist", Visible: true, Searchable: true, Orderable: true, Filterable: true, FilterPlaceholder: "filter Name"},
|
||||||
datatable.DisplayField{Field: "status", Title: "Status", Visible: true, Searchable: true, Orderable: true, Filterable: true, FilterPlaceholder: "All Statuses", FilterItems: statusFilterItems},
|
{Field: "status", Title: "Status", Visible: true, Searchable: true, Orderable: true, Filterable: true, FilterPlaceholder: "All Statuses", FilterItems: statusFilterItems},
|
||||||
datatable.DisplayField{Field: "updated_at", Title: "Last Updated", Visible: true, Searchable: true, Orderable: true, Filterable: false},
|
{Field: "updated_at", Title: "Last Updated", Visible: true, Searchable: true, Orderable: true, Filterable: false},
|
||||||
datatable.DisplayField{Field: "created_at", Title: "Created", Visible: true, Searchable: true, Orderable: true, Filterable: false},
|
{Field: "created_at", Title: "Created", Visible: true, Searchable: true, Orderable: true, Filterable: false},
|
||||||
}
|
}
|
||||||
|
|
||||||
mapFunc := func(q *checklist.Checklist, cols []datatable.DisplayField) (resp []datatable.ColumnValue, err error) {
|
mapFunc := func(q *checklist.Checklist, cols []datatable.DisplayField) (resp []datatable.ColumnValue, err error) {
|
||||||
|
@ -90,11 +90,11 @@ func (h *Users) Index(ctx context.Context, w http.ResponseWriter, r *http.Reques
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields := []datatable.DisplayField{
|
fields := []datatable.DisplayField{
|
||||||
datatable.DisplayField{Field: "id", Title: "ID", Visible: false, Searchable: true, Orderable: true, Filterable: false},
|
{Field: "id", Title: "ID", Visible: false, Searchable: true, Orderable: true, Filterable: false},
|
||||||
datatable.DisplayField{Field: "name", Title: "User", Visible: true, Searchable: true, Orderable: true, Filterable: true, FilterPlaceholder: "filter Name"},
|
{Field: "name", Title: "User", Visible: true, Searchable: true, Orderable: true, Filterable: true, FilterPlaceholder: "filter Name"},
|
||||||
datatable.DisplayField{Field: "status", Title: "Status", Visible: true, Searchable: true, Orderable: true, Filterable: true, FilterPlaceholder: "All Statuses", FilterItems: statusFilterItems},
|
{Field: "status", Title: "Status", Visible: true, Searchable: true, Orderable: true, Filterable: true, FilterPlaceholder: "All Statuses", FilterItems: statusFilterItems},
|
||||||
datatable.DisplayField{Field: "updated_at", Title: "Last Updated", Visible: true, Searchable: true, Orderable: true, Filterable: false},
|
{Field: "updated_at", Title: "Last Updated", Visible: true, Searchable: true, Orderable: true, Filterable: false},
|
||||||
datatable.DisplayField{Field: "created_at", Title: "Created", Visible: true, Searchable: true, Orderable: true, Filterable: false},
|
{Field: "created_at", Title: "Created", Visible: true, Searchable: true, Orderable: true, Filterable: false},
|
||||||
}
|
}
|
||||||
|
|
||||||
mapFunc := func(q *user_account.User, cols []datatable.DisplayField) (resp []datatable.ColumnValue, err error) {
|
mapFunc := func(q *user_account.User, cols []datatable.DisplayField) (resp []datatable.ColumnValue, err error) {
|
||||||
|
@ -615,7 +615,7 @@ func TestCrud(t *testing.T) {
|
|||||||
t.Fatalf("\t%s\tVerify update user account failed.", tests.Failed)
|
t.Fatalf("\t%s\tVerify update user account failed.", tests.Failed)
|
||||||
} else if tt.findErr == nil {
|
} else if tt.findErr == nil {
|
||||||
var expected UserAccounts = []*UserAccount{
|
var expected UserAccounts = []*UserAccount{
|
||||||
&UserAccount{
|
{
|
||||||
//ID: ua.ID,
|
//ID: ua.ID,
|
||||||
UserID: ua.UserID,
|
UserID: ua.UserID,
|
||||||
AccountID: ua.AccountID,
|
AccountID: ua.AccountID,
|
||||||
@ -657,7 +657,7 @@ func TestCrud(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var expected UserAccounts = []*UserAccount{
|
var expected UserAccounts = []*UserAccount{
|
||||||
&UserAccount{
|
{
|
||||||
//ID: ua.ID,
|
//ID: ua.ID,
|
||||||
UserID: ua.UserID,
|
UserID: ua.UserID,
|
||||||
AccountID: ua.AccountID,
|
AccountID: ua.AccountID,
|
||||||
|
@ -317,10 +317,10 @@ func TestSwitchAccount(t *testing.T) {
|
|||||||
// Test all the combinations there the user has access to all three accounts.
|
// Test all the combinations there the user has access to all three accounts.
|
||||||
if true {
|
if true {
|
||||||
for _, roles := range [][]user_account.UserAccountRole{
|
for _, roles := range [][]user_account.UserAccountRole{
|
||||||
[]user_account.UserAccountRole{user_account.UserAccountRole_Admin, user_account.UserAccountRole_Admin, user_account.UserAccountRole_Admin},
|
{user_account.UserAccountRole_Admin, user_account.UserAccountRole_Admin, user_account.UserAccountRole_Admin},
|
||||||
[]user_account.UserAccountRole{user_account.UserAccountRole_User, user_account.UserAccountRole_User, user_account.UserAccountRole_User},
|
{user_account.UserAccountRole_User, user_account.UserAccountRole_User, user_account.UserAccountRole_User},
|
||||||
[]user_account.UserAccountRole{user_account.UserAccountRole_Admin, user_account.UserAccountRole_User, user_account.UserAccountRole_Admin},
|
{user_account.UserAccountRole_Admin, user_account.UserAccountRole_User, user_account.UserAccountRole_Admin},
|
||||||
[]user_account.UserAccountRole{user_account.UserAccountRole_User, user_account.UserAccountRole_Admin, user_account.UserAccountRole_User},
|
{user_account.UserAccountRole_User, user_account.UserAccountRole_Admin, user_account.UserAccountRole_User},
|
||||||
} {
|
} {
|
||||||
// Create a new user for testing.
|
// Create a new user for testing.
|
||||||
usrAcc, err := user_account.MockUserAccount(ctx, test.MasterDB, now, roles[0])
|
usrAcc, err := user_account.MockUserAccount(ctx, test.MasterDB, now, roles[0])
|
||||||
|
Reference in New Issue
Block a user