factory

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UdmDefaultTLSKeyLogPath       = "./log/udmsslkey.log"
	UdmDefaultCertPemPath         = "./cert/udm.pem"
	UdmDefaultPrivateKeyPath      = "./cert/udm.key"
	UdmDefaultConfigPath          = "./config/udmcfg.yaml"
	UdmSbiDefaultIPv4             = "127.0.0.3"
	UdmSbiDefaultPort             = 8000
	UdmSbiDefaultScheme           = "https"
	UdmDefaultNrfUri              = "https://127.0.0.10:8000"
	UdmSorprotectionResUriPrefix  = "/nudm-sorprotection/v1"
	UdmAuthResUriPrefix           = "/nudm-auth/v1"
	UdmfUpuprotectionResUriPrefix = "/nudm-upuprotection/v1"
	UdmEcmResUriPrefix            = "/nudm-ecm/v1"
	UdmSdmResUriPrefix            = "/nudm-sdm/v1"
	UdmEeResUriPrefix             = "/nudm-ee/v1"
	UdmDrResUriPrefix             = "/nudr-dr/v1"
	UdmUecmResUriPrefix           = "/nudm-uecm/v1"
	UdmPpResUriPrefix             = "/nudm-pp/v1"
	UdmUeauResUriPrefix           = "/nudm-ueau/v1"
)

Variables

This section is empty.

Functions

func InitConfigFactory

func InitConfigFactory(f string, cfg *Config) error

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 UdmConfig *Config

func ReadConfig

func ReadConfig(cfgPath string) (*Config, error)

func (*Config) GetCertKeyPath

func (c *Config) GetCertKeyPath() string

func (*Config) GetCertPemPath

func (c *Config) GetCertPemPath() string

func (*Config) GetLogEnable

func (c *Config) GetLogEnable() bool

func (*Config) GetLogLevel

func (c *Config) GetLogLevel() string

func (*Config) GetLogReportCaller

func (c *Config) GetLogReportCaller() bool

func (*Config) GetSbiBindingAddr

func (c *Config) GetSbiBindingAddr() string

func (*Config) GetSbiBindingIP

func (c *Config) GetSbiBindingIP() string

func (*Config) GetSbiPort

func (c *Config) GetSbiPort() int

func (*Config) GetSbiScheme

func (c *Config) GetSbiScheme() string

func (*Config) GetVersion

func (c *Config) GetVersion() string

func (*Config) SetLogEnable

func (c *Config) SetLogEnable(enable bool)

func (*Config) SetLogLevel

func (c *Config) SetLogLevel(level string)

func (*Config) SetLogReportCaller

func (c *Config) SetLogReportCaller(reportCaller bool)

func (*Config) Validate

func (c *Config) Validate() (bool, error)

type Configuration

type Configuration struct {
	Sbi             *Sbi               `yaml:"sbi,omitempty"  valid:"required"`
	ServiceNameList []string           `yaml:"serviceNameList,omitempty"  valid:"required"`
	NrfUri          string             `yaml:"nrfUri,omitempty"  valid:"required, url"`
	NrfCertPem      string             `yaml:"nrfCertPem,omitempty" valid:"optional"`
	SuciProfiles    []suci.SuciProfile `yaml:"SuciProfile,omitempty"`
}

type Info

type Info struct {
	Version     string `yaml:"version,omitempty" valid:"required,in(1.0.3)"`
	Description string `yaml:"description,omitempty" valid:"type(string)"`
}

type Logger

type Logger struct {
	Enable       bool   `yaml:"enable" valid:"type(bool)"`
	Level        string `yaml:"level" valid:"required,in(trace|debug|info|warn|error|fatal|panic)"`
	ReportCaller bool   `yaml:"reportCaller" valid:"type(bool)"`
}

type Sbi

type Sbi struct {
	Scheme       string `yaml:"scheme" valid:"scheme"`
	RegisterIPv4 string `yaml:"registerIPv4,omitempty" valid:"host,required"` // IP that is registered at 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,required"`
	Tls         *Tls   `yaml:"tls,omitempty" valid:"optional"`
}

type Tls

type Tls struct {
	Pem string `yaml:"pem,omitempty" valid:"type(string),minstringlength(1),required"`
	Key string `yaml:"key,omitempty" valid:"type(string),minstringlength(1),required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL