-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
35 lines (31 loc) · 936 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package internal
import (
"github.com/fluffy-bunny/grpcdotnetgo/pkg/middleware/oidc"
)
type ExampleConfig struct {
GRPCPort int `mapstructure:"GRPC_PORT"`
Mode string `mapstructure:"MODE"`
OIDCConfig oidc.OIDCConfig `mapstructure:"OIDC_CONFIG"`
EnableTransient2 bool `mapstructure:"ENABLE_TRANSIENT_2"`
}
type Config struct {
Environment string `mapstructure:"APPLICATION_ENVIRONMENT"`
Example ExampleConfig `mapstructure:"EXAMPLE"`
}
func (c *Config) GetOIDCConfig() oidc.IOIDCConfig {
return &c.Example.OIDCConfig
}
// ConfigDefaultYaml default yaml
var ConfigDefaultYaml = []byte(`
{
"APPLICATION_ENVIRONMENT": "in-environment",
"EXAMPLE": {
"ENABLE_TRANSIENT_2": true,
"GRPC_PORT": 1111,
"OIDC_CONFIG": {
"AUTHORITY": "https://in-environment/",
"CRON_REFRESH_SCHEDULE": "@every 0h1m0s"
}
}
}
`)