example/stateful/controller.go
func (c *Controller) Request() error {
	req := &gdpr.Request{
		ApiVersion:       gdpr.ApiVersion,
		SubjectRequestId: uuid.NewV4().String(),
		SubjectIdentities: []gdpr.Identity{
			gdpr.Identity{
				Type:   gdpr.IDENTITY_EMAIL,
				Format: gdpr.FORMAT_RAW,
				Value:  "username@some-email.com",
			},
		},
		SubjectRequestType: gdpr.SUBJECT_ERASURE,
		StatusCallbackUrls: []string{
			"http://localhost:4001/opengdpr_callbacks",
		},
	}
	resp, err := c.client.Request(req)
	if err != nil {
		return err
	}
	c.mu.Lock()
	defer c.mu.Unlock()
	c.responses[resp.SubjectRequestId] = resp
	log.Printf("sent new gdpr request: %s", resp.SubjectRequestId)
	return nil
}
func (c *Controller) Request() error {
	req := &gdpr.Request{
		ApiVersion:       gdpr.ApiVersion,
		SubjectRequestId: uuid.NewV4().String(),
		SubjectIdentities: []gdpr.Identity{
			gdpr.Identity{
				Type:   gdpr.IDENTITY_EMAIL,
				Format: gdpr.FORMAT_RAW,
				Value:  "username@some-email.com",
			},
		},
		SubjectRequestType: gdpr.SUBJECT_ERASURE,
		StatusCallbackUrls: []string{
			"http://localhost:4001/opengdpr_callbacks",
		},
	}
	resp, err := c.client.Request(req)
	if err != nil {
		return err
	}
	c.mu.Lock()
	defer c.mu.Unlock()
	c.responses[resp.SubjectRequestId] = resp
	log.Printf("sent new gdpr request: %s", resp.SubjectRequestId)
	return nil
}
func ( c * Controller ) Request ( ) error { req := & gdpr . Request { ApiVersion : gdpr . ApiVersion , SubjectRequestId : uuid . NewV4 ( ) . String ( ) , SubjectIdentities : [ ] gdpr . Identity { gdpr . Identity { Type : gdpr . IDENTITY_EMAIL , Format : gdpr . FORMAT_RAW , Value : " " , } , } , SubjectRequestType : gdpr . SUBJECT_ERASURE , StatusCallbackUrls : [ ] string { " " , } , } resp , err := c . client . Request ( req ) if err != nil { return err } c . mu . Lock ( ) defer c . mu . Unlock ( ) c . responses [ resp . SubjectRequestId ] = resp log . Printf ( " " , resp . SubjectRequestId ) return nil }
// Request generates a random/fake GDPR request
Request generates a random / fake GDPR request