oam

package
v0.0.0-...-462693d Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AFServiceIDBaseValue = 123456

AFServiceIDBaseValue is base value for the id to allocate

Variables

View Source
var AllRecords []AFService

AllRecords store all the AFService

View Source
var NGCType string // APISTUB or 5GFLEXCORE

NGCType : type of ngc

View Source
var NewRecordAFServiceID int

NewRecordAFServiceID is id to allocate

View Source
var URLBase string

URLBase : base path

Functions

func APIStubAdd

func APIStubAdd(w http.ResponseWriter, r *http.Request)

APIStubAdd : add one to records

func APIStubDel

func APIStubDel(w http.ResponseWriter, r *http.Request)

APIStubDel : delete one from the records

func APIStubGet

func APIStubGet(w http.ResponseWriter, r *http.Request)

APIStubGet : get one from the records

func APIStubGetAll

func APIStubGetAll(w http.ResponseWriter, r *http.Request)

APIStubGetAll : get all records from stub

func APIStubGetRecordIndex

func APIStubGetRecordIndex(serviceID string) int

APIStubGetRecordIndex : get record by service id

func APIStubInit

func APIStubInit(apistubTestdatapath string) error

APIStubInit : stub init

func APIStubNewAFServiceID

func APIStubNewAFServiceID() string

APIStubNewAFServiceID : allocate new service id

func APIStubPrintAll

func APIStubPrintAll()

APIStubPrintAll : stub print all

func APIStubReset

func APIStubReset() error

APIStubReset : stub reset

func APIStubUpdate

func APIStubUpdate(w http.ResponseWriter, r *http.Request)

APIStubUpdate : update one from records

func Index

func Index(w http.ResponseWriter, r *http.Request)

Index : function for index

func InitProxy

func InitProxy(npcEndpoint string, redirectTarget string, path string) error

InitProxy : init proxy The proxy acts as reverse proxy to handle request from CNCA and forward it to the target. The target can be API_STUB_TEST or flexcore. NOTE: current version only support API_STUB.

func NewRouter

func NewRouter() *mux.Router

NewRouter : function of mux router

func ProxyAdd

func ProxyAdd(w http.ResponseWriter, r *http.Request)

ProxyAdd : add by proxy

func ProxyDel

func ProxyDel(w http.ResponseWriter, r *http.Request)

ProxyDel : del by proxy

func ProxyGet

func ProxyGet(w http.ResponseWriter, r *http.Request)

ProxyGet : get by proxy

func ProxyGetAll

func ProxyGetAll(w http.ResponseWriter, r *http.Request)

ProxyGetAll : get all by proxy

func ProxyUpdate

func ProxyUpdate(w http.ResponseWriter, r *http.Request)

ProxyUpdate : udpate byproxy

Types

type AFService

type AFService struct {
	AFServiceID     string          `json:"afServiceId,omitempty"`
	LocationService LocationService `json:"locationService,omitempty"`
}

AFService JSON struct

type AFServiceID

type AFServiceID struct {
	AFServiceID string `json:"afServiceId,omitempty"`
}

AFServiceID is ID of service

type AFServiceList

type AFServiceList struct {
	AfServiceList []AFService `json:"afServiceList,omitempty"`
}

AFServiceList JSON struct

type LocationService

type LocationService struct {
	DNAI   string `json:"dnai,omitempty"` //DNAI value
	DNN    string `json:"dnn,omitempty"`  //DNN value
	TAC    int    `json:"tac,omitempty"`
	PriDNS string `json:"priDns,omitempty"`
	SecDNS string `json:"secDns,omitempty"`
	UPFIP  string `json:"upfIp,omitempty"`
	SNSSAI string `json:"snssai,omitempty"`
}

LocationService JSON struct

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route : route handler structure

type Routes

type Routes []Route

Routes : slice for route

Jump to

Keyboard shortcuts

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