github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/rds/v1/datastores/results.go (about)

     1  package datastores
     2  
     3  import "github.com/huaweicloud/golangsdk"
     4  
     5  type DataStore struct {
     6  	ID        string `json:"id"`
     7  	Name      string `json:"name"`
     8  	DataStore string `json:"datastore"`
     9  	Image     string `json:"image"`
    10  	Packages  string `json:"packages"`
    11  	Active    int    `json:"active"`
    12  }
    13  
    14  type ListResult struct {
    15  	golangsdk.Result
    16  }
    17  
    18  func (lr ListResult) Extract() ([]DataStore, error) {
    19  	var a struct {
    20  		DataStores []DataStore `json:"datastores"`
    21  	}
    22  	err := lr.Result.ExtractInto(&a)
    23  	return a.DataStores, err
    24  }