index

package
v0.0.0-...-7fcd714 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2021 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIndex

func CheckIndex(slug string, index map[string]interface{}) (c bool)

func GetIndex

func GetIndex(s strapi.StrapiRestClient, col string) (ix map[string]interface{})

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL