ekstep

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2018 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EkstepIndex *bleve.Index
)
View Source
var RFd *os.File

Functions

func EcarDbIndexAddJsonDir

func EcarDbIndexAddJsonDir(i *bleve.Index, jsonDir string) error

func EcarDbIndexAddJsonFile

func EcarDbIndexAddJsonFile(i *bleve.Index, jsonDir, filename string) error

func EcarDbIndexCreate

func EcarDbIndexCreate(indexPath string) (*bleve.Index, error)

If index doesn't exist, create it

func EcarDbIndexRemoveJsonFile

func EcarDbIndexRemoveJsonFile(i *bleve.Index, jsonDir, filename string) error

func EkstepInit

func EkstepInit(router *mux.Router)

func MergeJson

func MergeJson(x1, x2 interface{}) (interface{}, error)

func SearchEngineInit

func SearchEngineInit(dbDir, indexName, jsonDir string)

func SearchFilterQueryAdd

func SearchFilterQueryAdd(filter *CommonUtilFilters, boolQ *query.BooleanQuery) (*query.BooleanQuery, error)

func UUIDGet

func UUIDGet() string

func UpdateManifestUrl

func UpdateManifestUrl(item *EcarManifestArchiveItems, jsonFileName string, urlStr *string, content_dir_name string) error

Types

type CommonUtilFilters

type CommonUtilFilters struct {
	AgeGroup           []string `json:"ageGroup,omitempty"` // 8-10
	Board              []string `json:"board,omitempty"`    // CBSE
	CompatibilityLevel struct {
		Max int64 `json:"max"` // 2
		Min int64 `json:"min"` // 1
	} `json:"compatibilityLevel,omitempty"`
	ContentType []string `json:"contentType,omitempty"` // Story
	Domain      []string `json:"domain,omitempty"`      // numeracy
	GradeLevel  []string `json:"gradeLevel,omitempty"`  // Grade 5
	GenieScore  struct {
		Min float64 `json:"min"` // 0
	} `json:"genieScore,omitempty"`
	Identifier []string `json:"identifier,omitempty"` // do_30031995
	Language   []string `json:"language,omitempty"`   // english
	Medium     []string `json:"medium,omitempty"`     // Hindi
	ObjectType []string `json:"objectType,omitempty"` // Content
	Subject    []string `json:"subject,omitempty"`    // domain
	Status     []string `json:"status,omitempty"`     // Live
}

type CommonUtilPageSectionsSearch

type CommonUtilPageSectionsSearch struct {
	Facets  []string          `json:"facets,omitempty"` // contentType
	Filters CommonUtilFilters `json:"filters"`
	Limit   int               `json:"limit,omitempty"`
	Mode    string            `json:"mode,omitempty"` // soft
	Query   string            `json:"query"`
	SortBy  *CommonUtilSortBy `json:"sort_by"`
}

type CommonUtilParams

type CommonUtilParams struct {
	Err      string `json:"err"`      //
	Errmsg   string `json:"errmsg"`   //
	Msgid    string `json:"msgid"`    // ff305d54-85b4-341b-da2f-eb6b9e5460fa
	Resmsgid string `json:"resmsgid"` // c3800c567711b10e128d3b1353328a60f6bb5583
	Status   string `json:"status"`   // successful
}

type CommonUtilSortBy

type CommonUtilSortBy struct {
	GenieScore      string `json:"genieScore,omitempty"`      // desc
	LastPublishedOn string `json:"lastPublishedOn,omitempty"` //desc
	Popularity      string `json:"popularity,omitempty"`      //desc
}

type ContentHomeRequest

type ContentHomeRequest struct {
	ID      string                    `json:"id"`  // ekstep.genie.content.home
	Ets     int64                     `json:"ets"` // 1.499853989625e+12
	Request ContentHomeRequestRequest `json:"request"`
	//Ver string `json:"ver,string"` // 1.0
	Ver string `json:"ver"` // 1.0
}

type ContentHomeRequestRequest

type ContentHomeRequestRequest struct {
	Context struct {
		Contentid string `json:"contentid"` //
		Did       string `json:"did"`       // 4e7839c64fe0b2da27a3d322a851a9038ee20240
		Dlang     string `json:"dlang"`     // en
		Uid       string `json:"uid"`       // 7c68ee48-7695-473f-8699-d1de2ff32beb
	} `json:"context"`
	Filters CommonUtilFilters `json:"filters"`
}

type ContentHomeResponse

type ContentHomeResponse struct {
	ID     string                    `json:"id"` // ekstep.genie.content.home
	Params CommonUtilParams          `json:"params"`
	Result ContentHomeResponseResult `json:"result"`
	Ts     time.Time                 `json:"ts"`  // 2017-06-13T12:05:30+00:00
	Ver    string                    `json:"ver"` // 1.0
}

type ContentHomeResponseResult

type ContentHomeResponseResult struct {
	Page ContentHomeUtilPage `json:"page"`
}

type ContentHomeUtilPage

type ContentHomeUtilPage struct {
	ID       string                        `json:"id"`                // org.ekstep.genie.content.home
	Banners  interface{}                   `json:"banners,omitempty"` // <nil>
	Sections []ContentHomeUtilPageSections `json:"sections"`
}

type ContentHomeUtilPageSections

type ContentHomeUtilPageSections struct {
	Display   ContentHomeUtilPageSectionsDisplay    `json:"display"`
	Recommend *ContentHomeUtilPageSectionsRecommend `json:"recommend"`
	//Recommend        ContentHomeUtilPageSectionsRecommend `json:"recommend,omitempty"`
	FilterModifiable bool                         `json:"filterModifiable"` // true
	Search           CommonUtilPageSectionsSearch `json:"search,omitempty"`
	//Contents         []ContentHomeUtilPageSectionsContents `json:"contents,omitempty"`
	Contents []EcarManifestArchiveItems `json:"contents,omitempty"`
	Apiid    string                     `json:"apiid,omitempty"` // ekstep.composite-search.search
}

type ContentHomeUtilPageSectionsDisplay

type ContentHomeUtilPageSectionsDisplay struct {
	Name struct {
		En string `json:"en"` // Best of Genie
		Hn string `json:"hn"` // लोकप्रिय कहानियां
	} `json:"name"`
}

type ContentHomeUtilPageSectionsRecommend

type ContentHomeUtilPageSectionsRecommend struct {
	Context struct {
		ContentId string `json:"contentid"`
		Did       string `json:"did"`
		Dlang     string `json:"dlang"`
	} `json:"context"`
	Facets  []string           `json:"facets,omitempty"` // contentType
	Filters *CommonUtilFilters `json:"filters"`
	Limit   int                `json:"limit,omitempty"`
	SortBy  *CommonUtilSortBy  `json:"sort_by"`
}

type ContentListingJson

type ContentListingJson struct {
	Page ContentHomeUtilPage `json:"page"`
}

type EcarManifest

type EcarManifest struct {
	ID      string              `json:"id"` // ekstep.content.archive
	Archive EcarManifestArchive `json:"archive"`
	Params  struct {
		Resmsgid string `json:"resmsgid"` // ec3cce5d-0acb-4eb1-8faf-c4684e1e71fc
	} `json:"params"`
	Ts string `json:"ts"` // 2016-10-12T11:24:31ZZ
	//Ver float64 `json:"ver,string"` // 1.1
	Ver string `json:"ver"` // 1.1
}

type EcarManifestArchive

type EcarManifestArchive struct {
	Count int64                      `json:"count"` // 1
	Items []EcarManifestArchiveItems `json:"items"`
	Ttl   int64                      `json:"ttl"` // 24
}

type EcarManifestArchiveItems

type EcarManifestArchiveItems struct {
	AgeGroup    []string `json:"ageGroup,omitempty"`    // 5-6
	AppIcon     *string  `json:"appIcon,omitempty"`     // do_20050809/2739a02c883a1ed624269674ee66ff8c_1476271391484.jpeg
	ArtifactURL *string  `json:"artifactUrl,omitempty"` // do_20051496/1476944125977_do_20051496.zip

	Children []EcarManifestArchiveItemsChildren `json:"children,omitempty"`

	Code               string  `json:"code,omitempty"`               // org.ekstep.literacy.game.2560
	CompatibilityLevel float64 `json:"compatibilityLevel,omitempty"` // 1
	ConsumerID         string  `json:"consumerId,omitempty"`
	ContentMetadata    struct {
		Virality struct {
			Origin        string  `json:"origin"`
			TransferCount float64 `json:"transferCount"`
		} `json:"virality,omitempty"`
	} `json:"contentMetadata,omitempty"`
	ContentType        string                            `json:"contentType,omitempty"` // Game
	ContentTypesCount  string                            `json:"contentTypesCount,omitempty"`
	Copyright          string                            `json:"copyright,omitempty"` //
	CreatedBy          string                            `json:"createdBy,omitempty"`
	CreatedOn          string                            `json:"createdOn,omitempty"`          // 2016-10-12T11:22:30.511+0000
	Creator            string                            `json:"creator,omitempty"`            // Debesh Rout
	Description        string                            `json:"description,omitempty"`        // Test lessonsTest lessons
	Developer          string                            `json:"developer,omitempty"`          // Ekstep
	Domain             []string                          `json:"domain,omitempty"`             // literacy
	DownloadURL        *string                           `json:"downloadUrl,omitempty"`        // <nil>
	EsMetadataID       string                            `json:"es_metadata_id"`               // do_20050809
	FlagReasons        interface{}                       `json:"flagReasons,omitempty"`        // <nil>
	GradeLevel         []string                          `json:"gradeLevel,omitempty"`         // Kindergarten
	IDealScreenDensity string                            `json:"idealScreenDensity,omitempty"` // hdpi
	IDealScreenSize    string                            `json:"idealScreenSize,omitempty"`    // normal
	IDentifier         string                            `json:"identifier"`                   // do_20050809
	Language           []string                          `json:"language,omitempty"`           // Assamese
	LastPublishedOn    string                            `json:"lastPublishedOn,omitempty"`    // 2016-10-12T11:24:28.018+0000
	LastSubmittedOn    string                            `json:"lastSubmittedOn,omitempty"`    // 2016-07-05T13:32:18.745+0000"
	LastPublishedBy    string                            `json:"lastPublishedBy,omitempty"`    // 582
	LastUpdatedBy      string                            `json:"lastUpdatedBy,omitempty"`      // Ekstep
	LastUpdatedOn      string                            `json:"lastUpdatedOn,omitempty"`      // 2016-10-12T11:24:28.156+0000
	License            string                            `json:"license,omitempty"`            // Creative Commons Attribution (CC BY)
	MediaType          string                            `json:"mediaType,omitempty"`          // content
	Medium             string                            `json:"medium,omitempty"`             // Oriya
	MimeType           string                            `json:"mimeType,omitempty"`           // application/vnd.android.package-archive
	Name               string                            `json:"name,omitempty"`               // game
	ObjectType         string                            `json:"objectType"`                   // Content
	Organization       []string                          `json:"organization,omitempty"`       //
	Os                 []string                          `json:"os,omitempty"`                 // All
	OsID               string                            `json:"osId,omitempty"`               // org.ekstep.quiz.app
	Owner              string                            `json:"owner,omitempty"`              // Mangesh Mane
	PkgVersion         float64                           `json:"pkgversion,omitempty"`         // 1.1
	PortalOwner        string                            `json:"portalOwner,omitempty"`        // EkStep
	PosterImage        *string                           `json:"posterImage,omitempty"`        // domain_4058/story4_1463738637957.png
	PrevState          string                            `json:"prevState,omitempty"`          // Review
	PublishError       interface{}                       `json:"publishError,omitempty"`       // <nil>
	Publisher          string                            `json:"publisher,omitempty"`          //
	S3Key              string                            `json:"s3Key,omitempty"`              // ecar_files/do_20050809_1476271467871.ecar
	Size               float64                           `json:"size,omitempty"`               // 10864
	Source             string                            `json:"source,omitempty"`             //
	Status             string                            `json:"status,omitempty"`             // Live
	Subject            string                            `json:"subject,omitempty"`            // domain
	Tags               []string                          `json:"tags,omitempty"`
	Template           string                            `json:"template,omitempty"` //
	Variants           *EcarManifestArchiveItemsVariants `json:"variants,omitempty"`
	VersionKey         string                            `json:"versionKey,omitempty"` // 1494534207770
	Visibility         string                            `json:"visibility,omitempty"` // Default
}

func SearchEcarByIdentifier

func SearchEcarByIdentifier(ids []string) (EcarManifestArchiveItems, error)

func SearchQueryByEcarManifestItemsIdentifier(ids []string) (string, error) {

func (*EcarManifestArchiveItems) Type

func (e *EcarManifestArchiveItems) Type() string

type EcarManifestArchiveItemsChildren

type EcarManifestArchiveItemsChildren struct {
	Description interface{} `json:"description"`
	IDentifier  string      `json:"identifier"` // do_30030595
	Index       float64     `json:"index"`      // 9.0
	Name        string      `json:"name"`       // PC Barahkhadi
	ObjectType  string      `json:"objectType"` // Content
	Relation    string      `json:"relation"`   // hasSequenceMember
}

type EcarManifestArchiveItemsVariants

type EcarManifestArchiveItemsVariants struct {
	Spine struct {
		EcarURL string  `json:"ecarUrl"`
		Size    float64 `json:"size"`
	} `json:"spine,omitempty"`
}

type EkstepConfig

type EkstepConfig struct {
	// contains filtered or unexported fields
}
var EkstepConfigGlobal *EkstepConfig

func (*EkstepConfig) ContentListingJsonLoad

func (ms *EkstepConfig) ContentListingJsonLoad() ContentListingJson

type SearchIdResponse

type SearchIdResponse struct {
	ID     string           `json:"id"` // ekstep.composite-search.search
	Params CommonUtilParams `json:"params"`

	ResponseCode string `json:"responseCode"` // OK
	Result       struct {
		Content EcarManifestArchiveItems `json:"content,omitempty"`
		Count   int64                    `json:"count"` // 674
		Facets  []struct {
			Name   string `json:"name"` // gradeLevel
			Values []struct {
				Count int64  `json:"count"` // 146
				Name  string `json:"name"`  // other
			} `json:"values"`
		} `json:"facets,omitempty"`
	} `json:"result"`
	Ts  string  `json:"ts"`         // 2017-06-21T08:45:23ZZ
	Ver float64 `json:"ver,string"` // 2.0
}

type SearchRequest

type SearchRequest struct {
	Request CommonUtilPageSectionsSearch `json:"request"`
}

type SearchResponse

type SearchResponse struct {
	ID     string           `json:"id"` // ekstep.composite-search.search
	Params CommonUtilParams `json:"params"`

	ResponseCode string `json:"responseCode"` // OK
	Result       struct {
		Content []EcarManifestArchiveItems `json:"content,omitempty"`
		Count   int64                      `json:"count"` // 674
		Facets  []struct {
			Name   string `json:"name"` // gradeLevel
			Values []struct {
				Count int64  `json:"count"` // 146
				Name  string `json:"name"`  // other
			} `json:"values"`
		} `json:"facets,omitempty"`
	} `json:"result"`
	Ts  string  `json:"ts"`         // 2017-06-21T08:45:23ZZ
	Ver float64 `json:"ver,string"` // 2.0
}

Jump to

Keyboard shortcuts

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