pulumi/pkg/util/mapper
joeduffy 5f9ed13069 Simplify Check; make it tolerant of computed values
This change simplifies the generated Check interface for providers.
Instead of

    Check(ctx context.Context, obj *T) ([]error, error)

where T is the resource type, we have

    Check(ctx context.Context, obj *T, property string) error

This is done so that we can drive the calls to Check one property
at a time, allowing us to skip any that are computed.  (Otherwise,
we may fail the verification erroneously.)

This has the added advantage that the Check implementations are
simpler and can simply return a single error.  Furthermore, the
generated RPC code handles wrapping the result, so we can just do

    return errors.New("bad");

rather than the previous reflection-laden junk

    return resource.NewFieldError(
        reflect.TypeOf(obj), awsservice.AWSResource_Property,
        errors.New("bad"))
2017-06-16 13:34:11 -07:00
..
errors.go Simplify Check; make it tolerant of computed values 2017-06-16 13:34:11 -07:00
mapper.go Implement mapper.Encode "for real" 2017-06-05 17:49:00 -07:00
mapper_decode.go Simplify Check; make it tolerant of computed values 2017-06-16 13:34:11 -07:00
mapper_encode.go Implement mapper.Encode "for real" 2017-06-05 17:49:00 -07:00
mapper_test.go Model resource ID and URN as output properties 2017-06-14 17:00:13 -07:00
object.go Implement mapper.Encode "for real" 2017-06-05 17:49:00 -07:00