factory

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UpfDefaultConfigPath = "./config/upfcfg.yaml"
	UpfDefaultIPv4       = "127.0.0.8"
	UpfPfcpDefaultPort   = 8805
	UpfGtpDefaultPort    = 2152
)

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 {
	Version     string    `yaml:"version"     valid:"required,in(1.0.3)"`
	Description string    `yaml:"description" valid:"optional"`
	Pfcp        *Pfcp     `yaml:"pfcp"        valid:"required"`
	Gtpu        *Gtpu     `yaml:"gtpu"        valid:"required"`
	DnnList     []DnnList `yaml:"dnnList"     valid:"required"`
	Logger      *Logger   `yaml:"logger"      valid:"required"`
}

func ReadConfig

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

func (*Config) GetVersion

func (c *Config) GetVersion() string

func (*Config) Print

func (c *Config) Print()

type DnnList

type DnnList struct {
	Dnn       string `yaml:"dnn"       valid:"required"`
	Cidr      string `yaml:"cidr"      valid:"required,cidr"`
	NatIfName string `yaml:"natifname" valid:"optional"`
}

type Gtpu

type Gtpu struct {
	Forwarder string   `yaml:"forwarder" valid:"required,in(gtp5g)"`
	IfList    []IfInfo `yaml:"ifList"    valid:"optional"`
}

type IfInfo

type IfInfo struct {
	Addr   string `yaml:"addr"   valid:"required,host"`
	Type   string `yaml:"type"   valid:"required,in(N3|N9)"`
	Name   string `yaml:"name"   valid:"optional"`
	IfName string `yaml:"ifname" valid:"optional"`
	MTU    uint32 `yaml:"mtu"    valid:"optional"`
}

type Logger

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

type Pfcp

type Pfcp struct {
	Addr           string        `yaml:"addr"           valid:"required,host"`
	NodeID         string        `yaml:"nodeID"         valid:"required,host"`
	RetransTimeout time.Duration `yaml:"retransTimeout" valid:"required"`
	MaxRetrans     uint8         `yaml:"maxRetrans"     valid:"optional"`
}

Jump to

Keyboard shortcuts

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