factory

package
v0.0.0-...-2ef2313 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TngfExpectedConfigVersion = "1.0.3"
)

Variables

This section is empty.

Functions

func CheckConfigVersion

func CheckConfigVersion() error

func InitConfigFactory

func InitConfigFactory(f string) 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_util.Logger `yaml:"logger" valid:"optional"`
}
var TngfConfig Config

func (*Config) GetVersion

func (c *Config) GetVersion() string

func (*Config) Validate

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

type Configuration

type Configuration struct {
	TNGFInfo         context.TNGFNFInfo         `yaml:"TNGFInformation" valid:"required"`
	AMFSCTPAddresses []context.AMFSCTPAddresses `yaml:"AMFSCTPAddresses" valid:"required"`

	TCPPort              uint16 `yaml:"NASTCPPort" valid:"port,required"`
	IKEBindAddr          string `yaml:"IKEBindAddress" valid:"host,required"`
	RadiusBindAddr       string `yaml:"RadiusBindAddress" valid:"host,required"`
	IPSecGatewayAddr     string `yaml:"IPSecTunnelAddress" valid:"host,required"`
	UEIPAddressRange     string `yaml:"UEIPAddressRange" valid:"cidr,required"`                // e.g. 10.0.1.0/24
	XfrmIfaceName        string `yaml:"XFRMInterfaceName" valid:"stringlength(1|10),optional"` // must != 0
	XfrmIfaceId          uint32 `yaml:"XFRMInterfaceID" valid:"numeric,optional"`              // must != 0
	GTPBindAddr          string `yaml:"GTPBindAddress" valid:"host,required"`
	FQDN                 string `yaml:"FQDN" valid:"url,required"` // e.g. tngf.free5gc.org
	PrivateKey           string `yaml:"PrivateKey" valid:"type(string),minstringlength(1),optional"`
	CertificateAuthority string `yaml:"CertificateAuthority" valid:"type(string),minstringlength(1),optional"`
	Certificate          string `yaml:"Certificate" valid:"type(string),minstringlength(1),optional"`
	RadiusSecret         string `yaml:"RadiusSecret" valid:"type(string),minstringlength(1),optional"`
}

type Info

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

Jump to

Keyboard shortcuts

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