Documentation
¶
Index ¶
- Constants
- func InitConfigFactory(f string, cfg *Config) error
- type Cert
- type Config
- func (c *Config) AreMetricsEnabled() bool
- func (c *Config) GetCertBasePath() string
- func (c *Config) GetLogEnable() bool
- func (c *Config) GetLogLevel() string
- func (c *Config) GetLogReportCaller() bool
- func (c *Config) GetMetricsBindingAddr() string
- func (c *Config) GetMetricsBindingIP() string
- func (c *Config) GetMetricsCertKeyPath() string
- func (c *Config) GetMetricsCertPemPath() string
- func (c *Config) GetMetricsNamespace() string
- func (c *Config) GetMetricsPort() int
- func (c *Config) GetMetricsScheme() string
- func (c *Config) GetNfInstanceId() string
- func (c *Config) GetNrfCertPemPath() string
- func (c *Config) GetNrfPrivKeyPath() string
- func (c *Config) GetOAuth() bool
- func (c *Config) GetRootCertPemPath() string
- func (c *Config) GetRootPrivKeyPath() string
- func (c *Config) GetSbiBindingAddr() string
- func (c *Config) GetSbiBindingIP() string
- func (c *Config) GetSbiPort() int
- func (c *Config) GetSbiRegisterAddr() string
- func (c *Config) GetSbiRegisterIP() string
- func (c *Config) GetSbiScheme() string
- func (c *Config) GetSbiUri() string
- func (c *Config) GetServiceNameList() []string
- func (c *Config) GetVersion() string
- func (c *Config) SetLogEnable(enable bool)
- func (c *Config) SetLogLevel(level string)
- func (c *Config) SetLogReportCaller(reportCaller bool)
- func (c *Config) Validate() (bool, error)
- type Configuration
- type Info
- type Logger
- type Metrics
- type Sbi
Constants ¶
View Source
const ( NrfDefaultTLSKeyLogPath = "./log/nrfsslkey.log" NrfDefaultCertPemPath = "./cert/nrf.pem" NrfDefaultPrivateKeyPath = "./cert/nrf.key" NrfDefaultRootCertPemPath = "./cert/root.pem" NrfDefaultRootPrivateKeyPath = "./cert/root.key" NrfDefaultConfigPath = "./config/nrfcfg.yaml" NrfDefaultNfInstanceIdEnvVar = "NRF_NF_INSTANCE_ID" NrfSbiDefaultIPv4 = "127.0.0.10" NrfSbiDefaultPort = 8000 NrfSbiDefaultScheme = "https" NrfMetricsDefaultEnabled = false NrfMetricsDefaultPort = 9091 NrfMetricsDefaultScheme = "https" NrfMetricsDefaultNamespace = "free5gc" NrfNfmResUriPrefix = "/nnrf-nfm/v1" NrfDiscResUriPrefix = "/nnrf-disc/v1" NrfBootstrappingPrefix = "/bootstrapping" )
Variables ¶
This section is empty.
Functions ¶
func InitConfigFactory ¶
TODO: Support configuration update from REST api
Types ¶
type Config ¶
type Config struct {
Info *Info `yaml:"info" valid:"required"`
Configuration *Configuration `yaml:"configuration" valid:"required"`
Logger *Logger `yaml:"logger" valid:"required"`
sync.RWMutex
}
var NrfConfig *Config
func ReadConfig ¶ added in v1.2.1
func (*Config) AreMetricsEnabled ¶ added in v1.4.0
func (*Config) GetCertBasePath ¶ added in v1.2.1
func (*Config) GetLogEnable ¶ added in v1.2.1
func (*Config) GetLogLevel ¶ added in v1.2.1
func (*Config) GetLogReportCaller ¶ added in v1.2.1
func (*Config) GetMetricsBindingAddr ¶ added in v1.4.0
func (*Config) GetMetricsBindingIP ¶ added in v1.4.0
func (*Config) GetMetricsCertKeyPath ¶ added in v1.4.0
func (*Config) GetMetricsCertPemPath ¶ added in v1.4.0
func (*Config) GetMetricsNamespace ¶ added in v1.4.0
func (*Config) GetMetricsPort ¶ added in v1.4.0
func (*Config) GetMetricsScheme ¶ added in v1.4.0
func (*Config) GetNfInstanceId ¶ added in v1.4.1
func (*Config) GetNrfCertPemPath ¶ added in v1.2.1
func (*Config) GetNrfPrivKeyPath ¶ added in v1.2.1
func (*Config) GetRootCertPemPath ¶ added in v1.2.1
func (*Config) GetRootPrivKeyPath ¶ added in v1.2.1
func (*Config) GetSbiBindingAddr ¶
func (*Config) GetSbiBindingIP ¶
func (*Config) GetSbiPort ¶
func (*Config) GetSbiRegisterAddr ¶
func (*Config) GetSbiRegisterIP ¶
func (*Config) GetSbiScheme ¶
func (*Config) GetServiceNameList ¶ added in v1.4.1
func (*Config) GetVersion ¶
func (*Config) SetLogEnable ¶ added in v1.2.1
func (*Config) SetLogLevel ¶ added in v1.2.1
func (*Config) SetLogReportCaller ¶ added in v1.2.1
type Configuration ¶
type Configuration struct {
NfInstanceId string `yaml:"nfInstanceId,omitempty" valid:"optional,uuidv4"`
Sbi *Sbi `yaml:"sbi,omitempty" valid:"required"`
Metrics *Metrics `yaml:"metrics,omitempty" valid:"optional"`
MongoDBName string `yaml:"MongoDBName" valid:"required"`
MongoDBUrl string `yaml:"MongoDBUrl" valid:"required"`
DefaultPlmnId models.PlmnId `yaml:"DefaultPlmnId" valid:"required"`
ServiceNameList []string `yaml:"serviceNameList,omitempty" valid:"required"`
}
type Metrics ¶ added in v1.4.0
type Metrics struct {
Enable bool `yaml:"enable" valid:"optional"`
Scheme string `yaml:"scheme" valid:"required,scheme"`
BindingIPv4 string `yaml:"bindingIPv4,omitempty" valid:"required,host"` // IP used to run the server in the node.
Port int `yaml:"port,omitempty" valid:"optional,port"`
Tls *Cert `yaml:"tls,omitempty" valid:"optional"`
Namespace string `yaml:"namespace" valid:"optional"`
}
type Sbi ¶
type Sbi struct {
Scheme string `yaml:"scheme" valid:"scheme,required"`
RegisterIPv4 string `yaml:"registerIPv4,omitempty" valid:"host,optional"`
// IP that is serviced or registered at another NRF.
// IPv6Addr string `yaml:"ipv6Addr,omitempty"`
BindingIPv4 string `yaml:"bindingIPv4,omitempty" valid:"host,required"` // IP used to run the server in the node.
Port int `yaml:"port,omitempty" valid:"port,optional"`
Cert *Cert `yaml:"cert,omitempty" valid:"optional"`
RootCert *Cert `yaml:"rootcert,omitempty" valid:"optional"`
OAuth bool `yaml:"oauth,omitempty" valid:"optional"`
}
Click to show internal directories.
Click to hide internal directories.