trying to apply oclib changes
This commit is contained in:
		| @@ -29,6 +29,9 @@ type HydraConnector struct { | ||||
| 	Caller *tools.HTTPCaller | ||||
| } | ||||
|  | ||||
| const test_name = "test-pierre" | ||||
| const test_id = "1234" | ||||
|  | ||||
| func (a HydraConnector) Status() tools.State { | ||||
| 	caller := tools.NewHTTPCaller(map[tools.DataType]map[tools.METHOD]string{}) | ||||
| 	var responseBody map[string]interface{} | ||||
| @@ -45,6 +48,7 @@ func (a HydraConnector) Status() tools.State { | ||||
| 	return tools.ALIVE | ||||
| } | ||||
|  | ||||
|  | ||||
| // urlFormat formats the URL of the peer with the data type API function | ||||
| func (a *HydraConnector) urlFormat(url string, replaceWith string) string { | ||||
| 	// localhost is replaced by the local peer URL | ||||
| @@ -176,7 +180,7 @@ func (a HydraConnector) Login(username string, cookies ...*http.Cookie) (t *Toke | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	json.Unmarshal(b, &m) | ||||
| 	pp := oclib.Search(nil, strconv.Itoa(peer.SELF.EnumIndex()), oclib.LibDataEnum(oclib.PEER)) | ||||
| 	pp := oclib.NewRequest(oclib.LibDataEnum(oclib.PEER),test_name,test_id,nil,nil).Search(nil, strconv.Itoa(peer.SELF.EnumIndex())) | ||||
| 	if len(pp.Data) == 0 || pp.Code >= 300 || pp.Err != "" { | ||||
| 		return nil, errors.New("peer not found") | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user