create

package
v0.0.0-...-ff01a36 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Create course

Available Parameters

Title
  • It is the name of the course. This has not to be unique if you want to create more than one course with the same name.
  • Maximum length is 60 characters
  • It is required
Language
  • It is the language where the course is created
  • It is a word of two characters representing the language. e.g norwegian => no
  • It is required
Description
  • Optional description about the course.
  • Maximum length is 200 characters
SourceURL

Optional URL where the course comes from

Tags

Optional array of tags to classify the course

Image

Optional file image.

Level

Mandatory paramter to classify the course as:

  • Beginner 1 (A1)
  • Beginner 2 (A2)
  • Intermediate 1 (B1)
  • Intermediate 2 (B2)
  • Advanced 1 (C1)
  • Advanced 2 (C2)
Examples

./go-lingq course create --title "er jeg liten?" --language no --level A1 -> this line will create a new course on the norwegian language, with the title "er jeg liten?" and a Beginner level (A1)

./go-lingq course create \
    --title "er jeg liten?" \
    --language no \
    --level A1 \
    --description "Det barnebok forklare forskjeller mellom stor og små" \
    --tags barnebok \
    --tags bok,barne \
    --image ./image.jpg

Documentation

Index

Constants

View Source
const (
	ImageName    = "image"
	ImageUsage   = "Specify here the filepath to the image that you want to upload"
	ImageDefault = utils.Empty

	TitleName    = "title"
	TitleUsage   = "Specify here the title of the course. It may contain spaces. Mandatory"
	TitleDefault = utils.Empty

	LanguageName    = "language"
	LanguageUsage   = "Specify the code of the language. It must be in two letter format. Mandatory"
	LanguageDefault = utils.Empty

	DescriptionName    = "description"
	DescriptionUsage   = "Specify here a description. It's optional. Max lenght must be	200 characters"
	DescriptionDefault = utils.Empty

	SourceURLName    = "source-url"
	SourceURLUsage   = "Specify the source URL of the course if appropiate"
	SourceURLDefault = utils.Empty

	TagsName  = "tags"
	TagsUsage = "Specify zero or more tags to classify the course. By default, empty"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CourseRequest

type CourseRequest struct {
	Image       string
	Title       string
	Language    string
	Description string
	Level       entities.ResourceLevel
	SourceURL   string
	Tags        []string
}

func (*CourseRequest) Args

func (c *CourseRequest) Args(cmd *cobra.Command)

func (CourseRequest) ToCommand

func (c CourseRequest) ToCommand() any

Jump to

Keyboard shortcuts

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