learn

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeLevel

func NormalizeLevel(level string) string

NormalizeLevel converts any level string to lowercase canonical form.

Types

type ItemType

type ItemType string

ItemType identifies the source content type for a learn item.

const (
	ItemJourney  ItemType = "journey"
	ItemTutorial ItemType = "tutorial"
	ItemMission  ItemType = "mission"
)

type LearnItem

type LearnItem struct {
	Type     ItemType
	Title    string
	Slug     string
	Level    string
	Duration string
	URL      string
	Featured bool
	PackID   string
	Product  string
}

LearnItem is a unified wrapper around content from any source.

func Search(
	journeys []learning.LearningJourney,
	tuts []tutorials.TutorialMeta,
	missions []discovery.Mission,
	query string,
	opts RecommendOptions,
) []LearnItem

type LearningPath

type LearningPath struct {
	ID          string
	Name        string
	Description string
	Level       string
	PackID      string
	Steps       []PathStep
	Generated   bool
}

LearningPath is a named, ordered sequence of learn items.

func AutoFillPaths

func AutoFillPaths(
	packs []*content.Pack,
	journeys []learning.LearningJourney,
	tuts []tutorials.TutorialMeta,
	missions []discovery.Mission,
) []LearningPath

func FindPath

func FindPath(paths []LearningPath, id string) *LearningPath

func LoadPaths

func LoadPaths(packs []*content.Pack) []LearningPath

func ResolvePaths

func ResolvePaths(
	paths []LearningPath,
	journeys []learning.LearningJourney,
	tuts []tutorials.TutorialMeta,
	missions []discovery.Mission,
) []LearningPath

type PathStep

type PathStep struct {
	Type ItemType
	Slug string
	Item *LearnItem
}

PathStep is a single step in a learning path.

type RecommendOptions

type RecommendOptions struct {
	Level  string
	PackID string
	All    bool
	Limit  int
}

RecommendOptions controls filtering for recommendations and search.

type Recommendations

type Recommendations struct {
	Journeys  []LearnItem
	Tutorials []LearnItem
	Missions  []LearnItem
}

Recommendations holds profile-filtered items grouped by type.

func Recommend

func Recommend(
	journeys []learning.LearningJourney,
	tuts []tutorials.TutorialMeta,
	missions []discovery.Mission,
	packs []*content.Pack,
	opts RecommendOptions,
) *Recommendations

Jump to

Keyboard shortcuts

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