Skip to content

Commit

Permalink
Refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
moredure committed Feb 3, 2019
1 parent 759633f commit 6863160
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package main

import "log"

func main() {
migrator, err := initializeApp()
app, err := initializeApp()
if err != nil {
panic(err)
log.Panicf("failed to initialize app %v\n", err)
}
migrator.Migrate()
app.Migrate()
}
8 changes: 4 additions & 4 deletions redis_clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type (
)

const (
REDIS_SOURCE = "REDIS_SOURCE"
REDIS_DESTINATION = "REDIS_DESTINATION"
RedisSource = "REDIS_SOURCE"
RedisDestination = "REDIS_DESTINATION"
)

func NewRedisOptionsFromEnv(key string) (*redis.Options, error) {
Expand All @@ -29,11 +29,11 @@ func NewRedisOptionsFromEnv(key string) (*redis.Options, error) {
}

func NewFromOptions() (FromOptions, error) {
return NewRedisOptionsFromEnv(REDIS_SOURCE)
return NewRedisOptionsFromEnv(RedisSource)
}

func NewToOptions() (ToOptions, error) {
return NewRedisOptionsFromEnv(REDIS_DESTINATION)
return NewRedisOptionsFromEnv(RedisDestination)
}

func NewRedisClients(from FromOptions, to ToOptions) RedisClients {
Expand Down

0 comments on commit 6863160

Please sign in to comment.