Loading go-apps/meep-tm/server/bwm/bwm.go +31 −2 Original line number Diff line number Diff line Loading @@ -430,7 +430,7 @@ func stopRegistrationTicker() { /** * IntializeBwBuffer initializes bandwidth buffer with maximum value and stores bandwidth buffer in redis * @return {String} error error message * @return {String} error It returns error message if bandwidth buffer is not stored properly in redis */ func IntializeBwBuffer() error { Loading @@ -456,7 +456,7 @@ func IntializeBwBuffer() error { /* * updateBuffer stores the updated values of bandwidth buffer * @param map[string]string buff Bandwidth buffer * @return {String} error error message * @return {String} error It returns error message if bandwidth buffer is not stored properly in redis */ func updateBuffer(buff map[string]string) error { entry := make(map[string]interface{}, len(buff)) Loading Loading @@ -1263,6 +1263,13 @@ func bandwidthAllocationPut(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, string(jsonResponse)) } /* * populateSessionFilter compares the requested session filters against session filters of the allocated resource allocations stored in redis * @param {string} key Bandwidth allocation stored with this key * @param {string} jsonInfo Bandwidth allocation information * @param {interface{}} response Bandwidth allocation information * @return {String} error error message */ func populateSessionFilter(key string, jsonInfo string, response interface{}) error { resp := response.(*SessionFilterResp) if resp == nil { Loading Loading @@ -1945,6 +1952,14 @@ func addBwBufferResource(bwInfoInput *BwInfo, w http.ResponseWriter) error { return nil } /* * sessionContains compares the slice of unique sessions with the passed single session of the requested allocation * @param {[]BwInfoSessionFilter} sessionSlice slice contains the unique sessions * @param {BwInfoSessionFilter} singleSessionFilter single session to be compared * @param {http.ResponseWriter} w writes HTTP reply * @return {[]BwInfoSessionFilter} returns the updated slice of sessionFilters * @return {error} An error will be return if occurs */ func sessionContains(sessionSlice []BwInfoSessionFilter, singleSessionFilter BwInfoSessionFilter) ([]BwInfoSessionFilter, error) { for _, sessionSlice1 := range sessionSlice { if reflect.DeepEqual(singleSessionFilter, sessionSlice1) { Loading Loading @@ -2004,6 +2019,13 @@ func validateBwInfoQueryParams(appInstanceId []string, appName []string, session return nil } /* * compareSessionFilters compares the requested allocation sessions with the existing unique sessions stored in redis of allocated resources * @param {string} key Bandwidth allocation stored with this key * @param {string} jsonInfo Bandwidth allocation information * @param {*BwAllocInfoResp} sessionFilterList Bandwidth allocation information * @return {String} error error message */ func compareSessionFilters(key string, jsonInfo string, sessionFilterList interface{}) error { // Get query params & bwInfo Loading @@ -2030,6 +2052,13 @@ func compareSessionFilters(key string, jsonInfo string, sessionFilterList interf return nil } /* * bandwidthResourceAllocation allocate bandwidth buffer resources uplink/downlink based on new requested Allocation direction (downlink, uplink and symmetrical) and fixedALloaction value and also assigns a unique allocation id. This function is only for bandwidthAllocationPost method. * @param {*BwInfo} bwInfoInput bandwidth Allocation information to be updated * @param {http.ResponseWriter} w writes HTTP reply * @return {error} error An error will be return if occurs */ func bandwidthResourceAllocation(bwInfo *BwInfo, w http.ResponseWriter) error { switch bwInfo.AllocationDirection { case "00": Loading Loading
go-apps/meep-tm/server/bwm/bwm.go +31 −2 Original line number Diff line number Diff line Loading @@ -430,7 +430,7 @@ func stopRegistrationTicker() { /** * IntializeBwBuffer initializes bandwidth buffer with maximum value and stores bandwidth buffer in redis * @return {String} error error message * @return {String} error It returns error message if bandwidth buffer is not stored properly in redis */ func IntializeBwBuffer() error { Loading @@ -456,7 +456,7 @@ func IntializeBwBuffer() error { /* * updateBuffer stores the updated values of bandwidth buffer * @param map[string]string buff Bandwidth buffer * @return {String} error error message * @return {String} error It returns error message if bandwidth buffer is not stored properly in redis */ func updateBuffer(buff map[string]string) error { entry := make(map[string]interface{}, len(buff)) Loading Loading @@ -1263,6 +1263,13 @@ func bandwidthAllocationPut(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, string(jsonResponse)) } /* * populateSessionFilter compares the requested session filters against session filters of the allocated resource allocations stored in redis * @param {string} key Bandwidth allocation stored with this key * @param {string} jsonInfo Bandwidth allocation information * @param {interface{}} response Bandwidth allocation information * @return {String} error error message */ func populateSessionFilter(key string, jsonInfo string, response interface{}) error { resp := response.(*SessionFilterResp) if resp == nil { Loading Loading @@ -1945,6 +1952,14 @@ func addBwBufferResource(bwInfoInput *BwInfo, w http.ResponseWriter) error { return nil } /* * sessionContains compares the slice of unique sessions with the passed single session of the requested allocation * @param {[]BwInfoSessionFilter} sessionSlice slice contains the unique sessions * @param {BwInfoSessionFilter} singleSessionFilter single session to be compared * @param {http.ResponseWriter} w writes HTTP reply * @return {[]BwInfoSessionFilter} returns the updated slice of sessionFilters * @return {error} An error will be return if occurs */ func sessionContains(sessionSlice []BwInfoSessionFilter, singleSessionFilter BwInfoSessionFilter) ([]BwInfoSessionFilter, error) { for _, sessionSlice1 := range sessionSlice { if reflect.DeepEqual(singleSessionFilter, sessionSlice1) { Loading Loading @@ -2004,6 +2019,13 @@ func validateBwInfoQueryParams(appInstanceId []string, appName []string, session return nil } /* * compareSessionFilters compares the requested allocation sessions with the existing unique sessions stored in redis of allocated resources * @param {string} key Bandwidth allocation stored with this key * @param {string} jsonInfo Bandwidth allocation information * @param {*BwAllocInfoResp} sessionFilterList Bandwidth allocation information * @return {String} error error message */ func compareSessionFilters(key string, jsonInfo string, sessionFilterList interface{}) error { // Get query params & bwInfo Loading @@ -2030,6 +2052,13 @@ func compareSessionFilters(key string, jsonInfo string, sessionFilterList interf return nil } /* * bandwidthResourceAllocation allocate bandwidth buffer resources uplink/downlink based on new requested Allocation direction (downlink, uplink and symmetrical) and fixedALloaction value and also assigns a unique allocation id. This function is only for bandwidthAllocationPost method. * @param {*BwInfo} bwInfoInput bandwidth Allocation information to be updated * @param {http.ResponseWriter} w writes HTTP reply * @return {error} error An error will be return if occurs */ func bandwidthResourceAllocation(bwInfo *BwInfo, w http.ResponseWriter) error { switch bwInfo.AllocationDirection { case "00": Loading