func DischargeAllWithKey(
	ctx context.Context,
	m *Macaroon,
	getDischarge func(ctx context.Context, cav macaroon.Caveat, encodedCaveat []byte) (*Macaroon, error),
	localKey *KeyPair,
) (macaroon.Slice, error) {
	discharges, err := Slice{m}.DischargeAll(ctx, getDischarge, localKey)
	if err != nil {
		return nil, errgo.Mask(err, errgo.Any)
	}
	return discharges.Bind(), nil
}
// DischargeAllWithKey is like DischargeAll except that the localKey
// parameter may optionally hold the key of the client, in which case it
// will be used to discharge any third party caveats with the special
// location "local". In this case, the caveat itself must be "true". This
// can be used be a server to ask a client to prove ownership of the
// private key.
//
// When localKey is nil, DischargeAllWithKey is exactly the same as
// DischargeAll.
DischargeAllWithKey is like DischargeAll except that the localKey
parameter may optionally hold the key of the client, in which case it
will be used to discharge any third party caveats with the special
location "local". In this case, the caveat itself must be "true". This
can be used be a server to ask a client to prove ownership of the
private key.

When localKey is nil, DischargeAllWithKey is exactly the same as
DischargeAll.
// DischargeAllWithKey is like DischargeAll except that the localKey // parameter may optionally hold the key of the client in which case it // will be used to discharge any third party caveats with the special // location " local " . In this case the caveat itself must be " true " . This // can be used be a server to ask a client to prove ownership of the // private key . // // When localKey is nil DischargeAllWithKey is exactly the same as // DischargeAll .
func DischargeAllWithKey(
	ctx context.Context,
	m *Macaroon,
	getDischarge func(ctx context.Context, cav macaroon.Caveat, encodedCaveat []byte) (*Macaroon, error),
	localKey *KeyPair,
) (macaroon.Slice, error) {
	discharges, err := Slice{m}.DischargeAll(ctx, getDischarge, localKey)
	if err != nil {
		return nil, errgo.Mask(err, errgo.Any)
	}
	return discharges.Bind(), nil
}
func DischargeAllWithKey ( ctx context . Context , m * Macaroon , getDischarge func ( ctx context . Context , cav macaroon . Caveat , encodedCaveat [ ] byte ) ( * Macaroon , error ) , localKey * KeyPair , ) ( macaroon . Slice , error ) { discharges , err := Slice { m } . DischargeAll ( ctx , getDischarge , localKey ) if err != nil { return nil , errgo . Mask ( err , errgo . Any ) } return discharges . Bind ( ) , nil }
DischargeAllWithKey is like DischargeAll except that the localKey
parameter may optionally hold the key of the client, in which case it
will be used to discharge any third party caveats with the special
location "local".
DischargeAllWithKey is like DischargeAll except that the localKey parameter may optionally hold the key of the client in which case it will be used to discharge any third party caveats with the special location " local " .