Adding the data model objects

Now that we have a skeleton of our chaincode ready, we can start adding our data objects. In the Go language, we define data objects as structured types as they always start with the type {name} struct expression.

Let's start by adding the code for the concept types following the declaration of type InsuranceChaincode struct {}:

// Concept Definitions - Concept struct types// ==========================================// AddressConcept - address typetype AddressConcept struct {  Class        string `json:"$class"`    //base.Address  AddressLine1 string `json:"addressLine1"`  AddressLine2 string `json:"addressLine2"`  AddressLine3 string `json:"addressLine3,omitempty"`}// LocationConcept - location typetype LocationConcept struct ...

Get Blockchain across Oracle now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.