Skip to content

Commit 3085464

Browse files
Add template logic for services/repos/controllers
1 parent 63b44a8 commit 3085464

File tree

6 files changed

+43
-0
lines changed

6 files changed

+43
-0
lines changed

cmd/internal/config/config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package config
2+
3+
// Load loads a config.
4+
func Load() (Config, error) {
5+
// TODO: load environment variables into the config using viper
6+
return Config{}, nil
7+
}

cmd/internal/config/models.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package config
2+
3+
// ServerConfig represents the configuration for the server.
4+
type ServerConfig struct {
5+
BindAddr string `mapstructure:"bind_address"`
6+
AppEnv string `mapstructure:"app_env"`
7+
}
8+
9+
// JWTConfig represents the configuration of the JWT secret
10+
type JWTConfig struct {
11+
Secret string `mapstructure:"secret"`
12+
}
13+
14+
// Config represents a yaml configuration file.
15+
type Config struct {
16+
Server ServerConfig
17+
JWT JWTConfig
18+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package controllers
2+
3+
func InitControllers() {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package repositories
2+
3+
func InitRepositories() {
4+
}

cmd/internal/services/bootstrap.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package services
2+
3+
func InitServices() {
4+
}

configs/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
server:
2+
bind_address: # Environment variable
3+
app_env: # Environment variable
4+
5+
jwt:
6+
secret: # Environment variable

0 commit comments

Comments
 (0)