Documentation ¶
Index ¶
- func CheckIndex(slug string, index map[string]interface{}) (c bool)
- func GetIndex(s strapi.StrapiRestClient, col string) (ix map[string]interface{})
- func SetIndex(s strapi.StrapiRestClient, slug string, collection []map[string]interface{}, ...) interface{}
- func SetIndexItem(s strapi.StrapiRestClient, slug string, item map[string]interface{}) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIndex ¶
func SetIndex ¶
func SetIndex(s strapi.StrapiRestClient, slug string, collection []map[string]interface{}, typeFunc func(c map[string]interface{}) interface{}) interface{}
type StrapiCoin struct { coin.Coin }
func (sc *StrapiCoin) New(params map[string]interface{}) {
sc.ID = int(params["id"].(float64)) sc.Price = params["price"].(float64) if val, ok := params["title"]; ok && val != nil { sc.Title = val.(string) } if val, ok := params["created_at"]; ok && val != nil { createdAt, t1Err := time.Parse(time.RFC3339, val.(string)) if t1Err != nil { sc.CreatedAt = createdAt } } //sc.Image = make([]StrapiProductImage, 0) // //if images, ok := params["image"]; ok && images != nil { // for _, e := range images.([]interface{}) { // imageMap := e.(map[string]interface{}) // var im StrapiProductImage // im.New(imageMap) // sc.Image = append(sc.Image, im) // } //}
}
func SetIndexS(s strapi.StrapiRestClient, indices map[string]struct{collection []map[string]interface{}, typeFunc func(c map[string]interface{}) interface{})} { for slug, index := range indices { return SetIndex(s,slug, index) } return nil }
func SetIndexItem ¶
func SetIndexItem(s strapi.StrapiRestClient, slug string, item map[string]interface{}) interface{}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.