Skip to content

Commit

Permalink
refactor SecretString in its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
negrel committed Jan 11, 2024
1 parent 8d599e5 commit cb3f5b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions internal/config/postgres.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package config

import "github.com/prismelabs/prismeanalytics/internal/secretstring"

// Postgres related options.
type Postgres struct {
Url SecretString
Url secretstring.SecretString
}

// PostgresFromEnv loads postgres related options from environment variables.
// This function panics if required environment variables are missing.
func PostgresFromEnv() Postgres {
return Postgres{
Url: NewSecretString(mustGetEnv("PRISME_POSTGRES_URL")),
Url: secretstring.NewSecretString(mustGetEnv("PRISME_POSTGRES_URL")),
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config
package secretstring

type SecretString struct {
value string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config
package secretstring

import (
"bytes"
Expand Down

0 comments on commit cb3f5b7

Please sign in to comment.