factory

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AmfDefaultTLSKeyLogPath  = "./log/amfsslkey.log"
	AmfDefaultCertPemPath    = "./cert/amf.pem"
	AmfDefaultPrivateKeyPath = "./cert/amf.key"
	AmfDefaultConfigPath     = "./config/amfcfg.yaml"
	AmfSbiDefaultIPv4        = "127.0.0.18"
	AmfSbiDefaultPort        = 8000
	AmfSbiDefaultScheme      = "https"
	AmfDefaultNrfUri         = "https://127.0.0.10:8000"

	AmfCallbackResUriPrefix = "/namf-callback/v1"
	AmfCommResUriPrefix     = "/namf-comm/v1"
	AmfEvtsResUriPrefix     = "/namf-evts/v1"
	AmfLocResUriPrefix      = "/namf-loc/v1"
	AmfMtResUriPrefix       = "/namf-mt/v1"
	AmfOamResUriPrefix      = "/namf-oam/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 AmfConfig *Config

func ReadConfig added in v1.2.1

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

func (*Config) GetCertKeyPath added in v1.2.4

func (c *Config) GetCertKeyPath() string

func (*Config) GetCertPemPath added in v1.2.4

func (c *Config) GetCertPemPath() string

func (*Config) GetLogEnable added in v1.2.1

func (c *Config) GetLogEnable() bool

func (*Config) GetLogLevel added in v1.2.1

func (c *Config) GetLogLevel() string

func (*Config) GetLogReportCaller added in v1.2.1

func (c *Config) GetLogReportCaller() bool

func (*Config) GetNasIENetworkFeatureSupport5GS added in v1.2.1

func (c *Config) GetNasIENetworkFeatureSupport5GS() *NetworkFeatureSupport5GS

func (*Config) GetNgapIEMaskedIMEISV added in v1.2.1

func (c *Config) GetNgapIEMaskedIMEISV() *MaskedIMEISV

func (*Config) GetNgapIEMobilityRestrictionList added in v1.2.1

func (c *Config) GetNgapIEMobilityRestrictionList() *MobilityRestrictionList

func (*Config) GetNgapIERedirectionVoiceFallback added in v1.2.1

func (c *Config) GetNgapIERedirectionVoiceFallback() *RedirectionVoiceFallback

func (*Config) GetNgapPort added in v1.2.1

func (c *Config) GetNgapPort() int

func (*Config) GetNrfUri added in v1.2.1

func (c *Config) GetNrfUri() string

func (*Config) GetSbiBindingAddr added in v1.2.1

func (c *Config) GetSbiBindingAddr() string

func (*Config) GetSbiBindingIP added in v1.2.1

func (c *Config) GetSbiBindingIP() string

func (*Config) GetSbiPort added in v1.2.1

func (c *Config) GetSbiPort() int

func (*Config) GetSbiRegisterAddr added in v1.2.1

func (c *Config) GetSbiRegisterAddr() string

func (*Config) GetSbiRegisterIP added in v1.2.1

func (c *Config) GetSbiRegisterIP() string

func (*Config) GetSbiScheme added in v1.2.1

func (c *Config) GetSbiScheme() string

func (*Config) GetSbiUri added in v1.2.1

func (c *Config) GetSbiUri() string

func (*Config) GetSctpConfig added in v1.2.1

func (c *Config) GetSctpConfig() *Sctp

func (*Config) GetServiceNameList added in v1.2.1

func (c *Config) GetServiceNameList() []string

func (*Config) GetVersion

func (c *Config) GetVersion() string

func (*Config) Print added in v1.2.1

func (c *Config) Print()

func (*Config) SetLogEnable added in v1.2.1

func (c *Config) SetLogEnable(enable bool)

func (*Config) SetLogLevel added in v1.2.1

func (c *Config) SetLogLevel(level string)

func (*Config) SetLogReportCaller added in v1.2.1

func (c *Config) SetLogReportCaller(reportCaller bool)

func (*Config) Validate

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

type Configuration

type Configuration struct {
	AmfName                string            `yaml:"amfName,omitempty" valid:"required, type(string)"`
	NgapIpList             []string          `yaml:"ngapIpList,omitempty" valid:"required"`
	NgapPort               int               `yaml:"ngapPort,omitempty" valid:"optional,port"`
	Sbi                    *Sbi              `yaml:"sbi,omitempty" valid:"required"`
	ServiceNameList        []string          `yaml:"serviceNameList,omitempty" valid:"required"`
	ServedGumaiList        []models.Guami    `yaml:"servedGuamiList,omitempty" valid:"required"`
	SupportTAIList         []models.Tai      `yaml:"supportTaiList,omitempty" valid:"required"`
	PlmnSupportList        []PlmnSupportItem `yaml:"plmnSupportList,omitempty" valid:"required"`
	SupportDnnList         []string          `yaml:"supportDnnList,omitempty" valid:"required"`
	SupportLadnList        []Ladn            `yaml:"supportLadnList,omitempty" valid:"optional"`
	NrfUri                 string            `yaml:"nrfUri,omitempty" valid:"required, url"`
	NrfCertPem             string            `yaml:"nrfCertPem,omitempty" valid:"optional"`
	Security               *Security         `yaml:"security,omitempty" valid:"required"`
	NetworkName            NetworkName       `yaml:"networkName,omitempty" valid:"required"`
	NgapIE                 *NgapIE           `yaml:"ngapIE,omitempty" valid:"optional"`
	NasIE                  *NasIE            `yaml:"nasIE,omitempty" valid:"optional"`
	T3502Value             int               `yaml:"t3502Value,omitempty" valid:"required, type(int)"`
	T3512Value             int               `yaml:"t3512Value,omitempty" valid:"required, type(int)"`
	Non3gppDeregTimerValue int               `yaml:"non3gppDeregTimerValue,omitempty" valid:"-"`
	T3513                  TimerValue        `yaml:"t3513" valid:"required"`
	T3522                  TimerValue        `yaml:"t3522" valid:"required"`
	T3550                  TimerValue        `yaml:"t3550" valid:"required"`
	T3560                  TimerValue        `yaml:"t3560" valid:"required"`
	T3565                  TimerValue        `yaml:"t3565" valid:"required"`
	T3570                  TimerValue        `yaml:"t3570" valid:"required"`
	T3555                  TimerValue        `yaml:"t3555" valid:"required"`
	Locality               string            `yaml:"locality,omitempty" valid:"type(string),optional"`
	SCTP                   *Sctp             `yaml:"sctp,omitempty" valid:"optional"`
	DefaultUECtxReq        bool              `yaml:"defaultUECtxReq,omitempty" valid:"type(bool),optional"`
}

type Info

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

type Ladn added in v1.2.1

type Ladn struct {
	Dnn     string       `yaml:"dnn" valid:"type(string),minstringlength(1),required"`
	TaiList []models.Tai `yaml:"taiList" valid:"required"`
}

type Logger added in v1.2.1

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 MaskedIMEISV added in v1.2.1

type MaskedIMEISV struct {
	Enable bool `yaml:"enable" valid:"type(bool)"`
}

type MobilityRestrictionList added in v1.2.1

type MobilityRestrictionList struct {
	Enable bool `yaml:"enable" valid:"type(bool)"`
}

type NasIE added in v1.2.1

type NasIE struct {
	NetworkFeatureSupport5GS *NetworkFeatureSupport5GS `yaml:"networkFeatureSupport5GS,omitempty" valid:"optional"`
}

type NetworkFeatureSupport5GS

type NetworkFeatureSupport5GS struct {
	Enable  bool  `yaml:"enable" valid:"type(bool)"`
	Length  uint8 `yaml:"length" valid:"type(uint8)"`
	ImsVoPS uint8 `yaml:"imsVoPS" valid:"type(uint8)"`
	Emc     uint8 `yaml:"emc" valid:"type(uint8)"`
	Emf     uint8 `yaml:"emf" valid:"type(uint8)"`
	IwkN26  uint8 `yaml:"iwkN26" valid:"type(uint8)"`
	Mpsi    uint8 `yaml:"mpsi" valid:"type(uint8)"`
	EmcN3   uint8 `yaml:"emcN3" valid:"type(uint8)"`
	Mcsi    uint8 `yaml:"mcsi" valid:"type(uint8)"`
}

type NetworkName

type NetworkName struct {
	Full  string `yaml:"full" valid:"type(string)"`
	Short string `yaml:"short,omitempty" valid:"type(string)"`
}

type NgapIE added in v1.2.1

type NgapIE struct {
	MobilityRestrictionList  *MobilityRestrictionList  `yaml:"mobilityRestrictionList,omitempty" valid:"optional"`
	MaskedIMEISV             *MaskedIMEISV             `yaml:"maskedIMEISV,omitempty" valid:"optional"`
	RedirectionVoiceFallback *RedirectionVoiceFallback `yaml:"redirectionVoiceFallback,omitempty" valid:"optional"`
}

type PlmnSupportItem

type PlmnSupportItem struct {
	PlmnId     *models.PlmnId  `yaml:"plmnId" valid:"required"`
	SNssaiList []models.Snssai `yaml:"snssaiList,omitempty" valid:"required"`
}

type RedirectionVoiceFallback added in v1.2.1

type RedirectionVoiceFallback struct {
	Enable bool `yaml:"enable" valid:"type(bool)"`
}

type Sbi

type Sbi struct {
	Scheme       string `yaml:"scheme" valid:"required,scheme"`
	RegisterIPv4 string `yaml:"registerIPv4,omitempty" valid:"required,host"` // IP that is registered at NRF.
	BindingIPv4  string `yaml:"bindingIPv4,omitempty" valid:"required,host"`  // IP used to run the server in the node.
	Port         int    `yaml:"port,omitempty" valid:"required,port"`
	Tls          *Tls   `yaml:"tls,omitempty" valid:"optional"`
}

type Sctp added in v1.2.1

type Sctp struct {
	NumOstreams    uint `yaml:"numOstreams,omitempty" valid:"int"`
	MaxInstreams   uint `yaml:"maxInstreams,omitempty" valid:"int"`
	MaxAttempts    uint `yaml:"maxAttempts,omitempty" valid:"int"`
	MaxInitTimeout uint `yaml:"maxInitTimeout,omitempty" valid:"int"`
}

type Security

type Security struct {
	IntegrityOrder []string `yaml:"integrityOrder,omitempty" valid:"-"`
	CipheringOrder []string `yaml:"cipheringOrder,omitempty" valid:"-"`
}

type TimerValue

type TimerValue struct {
	Enable        bool          `yaml:"enable" valid:"type(bool)"`
	ExpireTime    time.Duration `yaml:"expireTime" valid:"type(time.Duration)"`
	MaxRetryTimes int           `yaml:"maxRetryTimes,omitempty" valid:"type(int)"`
}

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