Documentation ¶
Index ¶
- Constants
- Variables
- func APIStubAdd(w http.ResponseWriter, r *http.Request)
- func APIStubDel(w http.ResponseWriter, r *http.Request)
- func APIStubGet(w http.ResponseWriter, r *http.Request)
- func APIStubGetAll(w http.ResponseWriter, r *http.Request)
- func APIStubGetRecordIndex(serviceID string) int
- func APIStubInit(apistubTestdatapath string) error
- func APIStubNewAFServiceID() string
- func APIStubPrintAll()
- func APIStubReset() error
- func APIStubUpdate(w http.ResponseWriter, r *http.Request)
- func Index(w http.ResponseWriter, r *http.Request)
- func InitProxy(npcEndpoint string, redirectTarget string, path string) error
- func NewRouter() *mux.Router
- func ProxyAdd(w http.ResponseWriter, r *http.Request)
- func ProxyDel(w http.ResponseWriter, r *http.Request)
- func ProxyGet(w http.ResponseWriter, r *http.Request)
- func ProxyGetAll(w http.ResponseWriter, r *http.Request)
- func ProxyUpdate(w http.ResponseWriter, r *http.Request)
- type AFService
- type AFServiceID
- type AFServiceList
- type LocationService
- type Route
- type Routes
Constants ¶
const AFServiceIDBaseValue = 123456
AFServiceIDBaseValue is base value for the id to allocate
Variables ¶
var AllRecords []AFService
AllRecords store all the AFService
var NGCType string // APISTUB or 5GFLEXCORE
NGCType : type of ngc
var NewRecordAFServiceID int
NewRecordAFServiceID is id to allocate
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 ¶
APIStubGetRecordIndex : get record by service id
func APIStubNewAFServiceID ¶
func APIStubNewAFServiceID() string
APIStubNewAFServiceID : allocate new service id
func APIStubUpdate ¶
func APIStubUpdate(w http.ResponseWriter, r *http.Request)
APIStubUpdate : update one from records
func InitProxy ¶
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 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