entities

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelName                  = "level"
	LevelUsage                 = "Specify here the level of your course."
	LevelDefault ResourceLevel = FirstLevel
)
View Source
const (
	PageName    = "page"
	PageUsage   = "set the page where to look for"
	PageDefault = 1

	SizeName    = "size"
	SizeUsage   = "set the max size that you want per size"
	SizeDefault = 20
)
View Source
const (
	ResourceStatusName  = "resource-status"
	ResourceStatusUsage = "specify the status of the resource: private or shared"
)
View Source
const (
	ResourceTypeName  = "resource-type"
	ResourceTypeUsage = "specify the type of resource that you want to look for: colletions or content"
)
View Source
const (
	SortByName  = "sort-by"
	SortByUsage = "sort results by availables options"
)

Variables

View Source
var (
	ResourceTypeValues          = [...]string{"collection", "content"}
	ResourceTypeUnmarshalValues = [...]string{"courses", "lessons"}
)
View Source
var Levels = [...]string{"A1", "A2", "B1", "B2", "C1", "C2"}
View Source
var ResourceStatusValue = [...]string{"private", "shared"}
View Source
var SortByValues = [...]string{
	"recentlyOpened",
	"recentlyImported",
	"oldest",
	"newest",
	"lessDifficult",
	"alphabetical",
}

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	Page, Size uint
}

func (*Pagination) Args

func (p *Pagination) Args(cmd *cobra.Command)

func (Pagination) String

func (p Pagination) String() string

func (Pagination) ToCommand

func (p Pagination) ToCommand() e.Pagination

type ResourceLevel

type ResourceLevel uint
const (
	FirstLevel ResourceLevel
	SecondLevel
	ThirdLevel
	FourthLevel
	FifthLevel
	SixthLevel
)

func (*ResourceLevel) Args

func (r *ResourceLevel) Args(cmd *cobra.Command)

func (*ResourceLevel) Check

func (r *ResourceLevel) Check(input string) bool

func (*ResourceLevel) Set

func (r *ResourceLevel) Set(input string) error

func (ResourceLevel) String

func (r ResourceLevel) String() string

func (ResourceLevel) ToDomain

func (r ResourceLevel) ToDomain() (level e.ResourceLevel, err error)

func (*ResourceLevel) Type

func (r *ResourceLevel) Type() string

type ResourceStatus

type ResourceStatus uint
const (
	PrivateResource ResourceStatus = iota
	SharedResource
)

func (*ResourceStatus) Args

func (r *ResourceStatus) Args(cmd *cobra.Command)

func (*ResourceStatus) Check

func (r *ResourceStatus) Check(input string) bool

func (*ResourceStatus) Set

func (r *ResourceStatus) Set(input string) error

func (ResourceStatus) String

func (r ResourceStatus) String() string

func (ResourceStatus) ToDomain

func (r ResourceStatus) ToDomain() (status e.ResourceStatus, err error)

func (*ResourceStatus) Type

func (r *ResourceStatus) Type() string

type ResourceType

type ResourceType uint
const (
	Course ResourceType = iota
	Lesson
)

func (*ResourceType) Args

func (r *ResourceType) Args(cmd *cobra.Command)

func (*ResourceType) Check

func (r *ResourceType) Check(input string) bool

func (*ResourceType) Set

func (r *ResourceType) Set(input string) error

func (ResourceType) String

func (r ResourceType) String() string

func (ResourceType) ToDomain

func (r ResourceType) ToDomain() (t e.ResourceType, err error)

func (*ResourceType) Type

func (r *ResourceType) Type() string

type ResourcesLevel

type ResourcesLevel utils.Set[ResourceLevel]

func (ResourcesLevel) InnerType

func (rr ResourcesLevel) InnerType() utils.Set[ResourceLevel]

func (*ResourcesLevel) Set

func (rr *ResourcesLevel) Set(input string) error

func (*ResourcesLevel) String

func (rr *ResourcesLevel) String() string

func (*ResourcesLevel) Type

func (rr *ResourcesLevel) Type() string

type SortBy

type SortBy uint
const (
	RecentlyOpenedSort SortBy = iota
	RecentlyImportedSort
	OldestSort
	NewestSort
	LessDifficultSort
	AlphabeticalSort
)

func (*SortBy) Args

func (r *SortBy) Args(cmd *cobra.Command)

func (*SortBy) Check

func (s *SortBy) Check(input string) bool

func (*SortBy) Set

func (s *SortBy) Set(input string) error

func (SortBy) String

func (s SortBy) String() string

func (SortBy) ToDomain

func (r SortBy) ToDomain() (sortBy e.SortBy, err error)

func (*SortBy) Type

func (s *SortBy) Type() string

Jump to

Keyboard shortcuts

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