github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/api/base/testing/apicaller.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package testing
     5  
     6  import "github.com/juju/names"
     7  
     8  // APICallerFunc is a function type that implements APICaller.
     9  type APICallerFunc func(objType string, version int, id, request string, params, response interface{}) error
    10  
    11  func (f APICallerFunc) APICall(objType string, version int, id, request string, params, response interface{}) error {
    12  	return f(objType, version, id, request, params, response)
    13  }
    14  
    15  func (APICallerFunc) BestFacadeVersion(facade string) int {
    16  	return 0
    17  }
    18  
    19  func (APICallerFunc) EnvironTag() (names.EnvironTag, error) {
    20  	return names.NewEnvironTag(""), nil
    21  }
    22  
    23  func (APICallerFunc) Close() error {
    24  	return nil
    25  }