launchpad.net/~rogpeppe/juju-core/500-errgo-fix@v0.0.0-20140213181702-000000002356/state/api/base/caller.go (about)

     1  // Copyright 2012, 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package base
     5  
     6  import (
     7  	"launchpad.net/errgo/errors"
     8  
     9  	"launchpad.net/juju-core/state/api/params"
    10  )
    11  
    12  // Caller is implemented by the client-facing State object.
    13  
    14  type Caller interface {
    15  	// Call makes a call to the API server with the given object type,
    16  	// id, request and parameters. The response is filled in with the
    17  	// call's result if the call is successful.
    18  	Call(objType, id, request string, params, response interface{}) error
    19  }
    20  
    21  // WrapError is like errors.Wrap but allows errors with
    22  // error codes to pass through.
    23  var WrapError = errors.MaskFunc(params.HasErrorCode)