Documentation
¶
Index ¶
- Variables
- type Author
- type Challenge
- type Client
- func (c *Client) CompleteChallenge(ctx context.Context, name string) (*Challenge, error)
- func (c *Client) CreateAuthor(ctx context.Context, req CreateAuthorRequest) (*Author, error)
- func (c *Client) CreateChallenge(ctx context.Context, req CreateChallengeRequest) (*Challenge, error)
- func (c *Client) CreateCourse(ctx context.Context, req CreateCourseRequest) (*Course, error)
- func (c *Client) CreatePlay(ctx context.Context, req CreatePlayRequest) (*Play, error)
- func (c *Client) CreatePlayground(ctx context.Context, req CreatePlaygroundRequest) (*Playground, error)
- func (c *Client) CreateSession(ctx context.Context) (*Session, error)
- func (c *Client) CreateSkillPath(ctx context.Context, req CreateSkillPathRequest) (*SkillPath, error)
- func (c *Client) CreateTutorial(ctx context.Context, req CreateTutorialRequest) (*Tutorial, error)
- func (c *Client) Delete(ctx context.Context, path string, query url.Values, headers http.Header) (*http.Response, error)
- func (c *Client) DeleteChallenge(ctx context.Context, name string) error
- func (c *Client) DeleteContentFile(ctx context.Context, kind content.ContentKind, name string, file string) error
- func (c *Client) DeleteCourse(ctx context.Context, name string) error
- func (c *Client) DeletePlay(ctx context.Context, id string) error
- func (c *Client) DeleteSession(ctx context.Context, id string) error
- func (c *Client) DeleteSkillPath(ctx context.Context, name string) error
- func (c *Client) DeleteTutorial(ctx context.Context, name string) error
- func (c *Client) Download(ctx context.Context, path string, query url.Values, headers http.Header, ...) error
- func (c *Client) DownloadContentFile(ctx context.Context, kind content.ContentKind, name string, file string, ...) error
- func (c *Client) DownloadTo(ctx context.Context, path string, query url.Values, headers http.Header, ...) error
- func (c *Client) Get(ctx context.Context, path string, query url.Values, headers http.Header) (*http.Response, error)
- func (c *Client) GetChallenge(ctx context.Context, name string) (*Challenge, error)
- func (c *Client) GetCourse(ctx context.Context, name string) (*Course, error)
- func (c *Client) GetInto(ctx context.Context, path string, query url.Values, headers http.Header, ...) error
- func (c *Client) GetMe(ctx context.Context) (*Me, error)
- func (c *Client) GetPlay(ctx context.Context, id string) (*Play, error)
- func (c *Client) GetPlayground(ctx context.Context, name string) (*Playground, error)
- func (c *Client) GetSession(ctx context.Context, id string) (*Session, error)
- func (c *Client) GetSkillPath(ctx context.Context, name string) (*SkillPath, error)
- func (c *Client) GetTutorial(ctx context.Context, name string) (*Tutorial, error)
- func (c *Client) ListAuthoredChallenges(ctx context.Context) ([]Challenge, error)
- func (c *Client) ListAuthoredCourses(ctx context.Context) ([]Course, error)
- func (c *Client) ListAuthoredSkillPaths(ctx context.Context) ([]SkillPath, error)
- func (c *Client) ListAuthoredTutorials(ctx context.Context) ([]Tutorial, error)
- func (c *Client) ListAuthors(ctx context.Context, filter ListAuthorsFilter) ([]Author, error)
- func (c *Client) ListChallenges(ctx context.Context, opts *ListChallengesOptions) ([]*Challenge, error)
- func (c *Client) ListContentFiles(ctx context.Context, kind content.ContentKind, name string) ([]string, error)
- func (c *Client) ListCourses(ctx context.Context) ([]Course, error)
- func (c *Client) ListPlaygrounds(ctx context.Context, opts *ListPlaygroundsOptions) ([]Playground, error)
- func (c *Client) ListPlays(ctx context.Context) ([]*Play, error)
- func (c *Client) ListSkillPaths(ctx context.Context) ([]SkillPath, error)
- func (c *Client) ListTutorials(ctx context.Context) ([]Tutorial, error)
- func (c *Client) Patch(ctx context.Context, path string, query url.Values, headers http.Header, ...) (*http.Response, error)
- func (c *Client) PatchInto(ctx context.Context, path string, query url.Values, headers http.Header, ...) error
- func (c *Client) Post(ctx context.Context, path string, query url.Values, headers http.Header, ...) (*http.Response, error)
- func (c *Client) PostInto(ctx context.Context, path string, query url.Values, headers http.Header, ...) error
- func (c *Client) Put(ctx context.Context, path string, query url.Values, headers http.Header, ...) (*http.Response, error)
- func (c *Client) PutContentMarkdown(ctx context.Context, kind content.ContentKind, name string, file string, ...) error
- func (c *Client) PutInto(ctx context.Context, path string, query url.Values, headers http.Header, ...) error
- func (c *Client) RequestPlayConn(ctx context.Context, id string) (*PlayConnHandle, error)
- func (c *Client) SetCredentials(sessionID, accessToken string)
- func (c *Client) StartChallenge(ctx context.Context, name string, opts StartChallengeOptions) (*Challenge, error)
- func (c *Client) StartTunnel(ctx context.Context, id string, req StartTunnelRequest) (*StartTunnelResponse, error)
- func (c *Client) StopChallenge(ctx context.Context, name string) (*Challenge, error)
- func (c *Client) UpdatePlayground(ctx context.Context, name string, req UpdatePlaygroundRequest) (*Playground, error)
- func (c *Client) Upload(ctx context.Context, url string, src io.Reader) (*http.Response, error)
- func (c *Client) UploadContentFile(ctx context.Context, kind content.ContentKind, name string, file string, ...) error
- func (c *Client) UploadFrom(ctx context.Context, url string, file string) (*http.Response, error)
- type ClientOptions
- type Course
- type CourseVariant
- type CreateAuthorRequest
- type CreateChallengeRequest
- type CreateCourseRequest
- type CreatePlayRequest
- type CreatePlaygroundRequest
- type CreateSkillPathRequest
- type CreateTutorialRequest
- type InitCondition
- type InitConditionValue
- type InitConditions
- type InitTask
- type ListAuthorsFilter
- type ListChallengesOptions
- type ListPlaygroundsOptions
- type Machine
- type MachineResources
- type MachineUser
- type Me
- type Play
- type PlayConn
- type PlayConnHandle
- type PlayConnMessage
- type PlayTask
- type PlayTaskStatus
- type Playground
- type PlaygroundAccess
- type PlaygroundMachine
- type PlaygroundManifest
- type PlaygroundSpec
- type PlaygroundTab
- type PortAccess
- type PremiumAccess
- type Session
- type SkillPath
- type StartChallengeOptions
- type StartTunnelRequest
- type StartTunnelResponse
- type Tutorial
- type UpdatePlaygroundRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAuthenticationRequired = errors.New("authentication required") ErrGatewayTimeout = errors.New("gateway timeout") )
Functions ¶
This section is empty.
Types ¶
type Challenge ¶ added in v0.0.4
type Challenge struct {
CreatedAt string `json:"createdAt" yaml:"createdAt"`
UpdatedAt string `json:"updatedAt" yaml:"updatedAt"`
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Categories []string `json:"categories" yaml:"categories"`
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
Authors []Author `json:"authors" yaml:"authors"`
PageURL string `json:"pageUrl" yaml:"pageUrl"`
AttemptCount int `json:"attemptCount" yaml:"attemptCount"`
CompletionCount int `json:"completionCount" yaml:"completionCount"`
Play *Play `json:"play,omitempty" yaml:"play,omitempty"`
Tasks map[string]PlayTask `json:"tasks,omitempty" yaml:"tasks,omitempty"`
}
func (*Challenge) GetKind ¶ added in v0.0.4
func (ch *Challenge) GetKind() content.ContentKind
func (*Challenge) GetPageURL ¶ added in v0.0.4
func (*Challenge) IsAuthoredBy ¶ added in v0.1.15
func (*Challenge) IsOfficial ¶ added in v0.1.15
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ClientOptions) *Client
func (*Client) CompleteChallenge ¶ added in v0.1.0
func (*Client) CreateAuthor ¶ added in v0.0.4
func (*Client) CreateChallenge ¶ added in v0.0.4
func (*Client) CreateCourse ¶ added in v0.0.4
func (*Client) CreatePlay ¶
func (*Client) CreatePlayground ¶ added in v0.1.15
func (c *Client) CreatePlayground(ctx context.Context, req CreatePlaygroundRequest) (*Playground, error)
func (*Client) CreateSession ¶
func (*Client) CreateSkillPath ¶ added in v0.1.5
func (*Client) CreateTutorial ¶ added in v0.0.4
func (*Client) DeleteChallenge ¶ added in v0.0.4
func (*Client) DeleteContentFile ¶ added in v0.0.4
func (*Client) DeleteCourse ¶ added in v0.0.4
func (*Client) DeleteSkillPath ¶ added in v0.1.5
func (*Client) DeleteTutorial ¶ added in v0.0.4
func (*Client) DownloadContentFile ¶ added in v0.0.4
func (*Client) DownloadTo ¶ added in v0.0.4
func (*Client) GetChallenge ¶ added in v0.0.4
func (*Client) GetPlayground ¶
func (*Client) GetSession ¶
func (*Client) GetSkillPath ¶ added in v0.1.5
func (*Client) GetTutorial ¶ added in v0.0.4
func (*Client) ListAuthoredChallenges ¶ added in v0.0.4
func (*Client) ListAuthoredCourses ¶ added in v0.0.4
func (*Client) ListAuthoredSkillPaths ¶ added in v0.1.5
func (*Client) ListAuthoredTutorials ¶ added in v0.0.4
func (*Client) ListAuthors ¶ added in v0.0.4
func (*Client) ListChallenges ¶ added in v0.0.4
func (*Client) ListContentFiles ¶ added in v0.0.4
func (*Client) ListCourses ¶ added in v0.0.4
func (*Client) ListPlaygrounds ¶
func (c *Client) ListPlaygrounds(ctx context.Context, opts *ListPlaygroundsOptions) ([]Playground, error)
func (*Client) ListSkillPaths ¶ added in v0.1.5
func (*Client) ListTutorials ¶ added in v0.0.4
func (*Client) PutContentMarkdown ¶ added in v0.0.4
func (*Client) RequestPlayConn ¶ added in v0.1.0
func (*Client) SetCredentials ¶
func (*Client) StartChallenge ¶ added in v0.1.0
func (*Client) StartTunnel ¶
func (c *Client) StartTunnel(ctx context.Context, id string, req StartTunnelRequest) (*StartTunnelResponse, error)
func (*Client) StopChallenge ¶ added in v0.1.0
func (*Client) UpdatePlayground ¶ added in v0.1.15
func (c *Client) UpdatePlayground(ctx context.Context, name string, req UpdatePlaygroundRequest) (*Playground, error)
func (*Client) UploadContentFile ¶ added in v0.0.4
type ClientOptions ¶
type Course ¶ added in v0.0.4
type Course struct {
CreatedAt string `json:"createdAt" yaml:"createdAt"`
UpdatedAt string `json:"updatedAt" yaml:"updatedAt"`
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
PageURL string `json:"pageUrl" yaml:"pageUrl"`
Authors []Author `json:"authors" yaml:"authors"`
}
func (*Course) GetKind ¶ added in v0.0.4
func (c *Course) GetKind() content.ContentKind
func (*Course) GetPageURL ¶ added in v0.0.4
func (*Course) IsAuthoredBy ¶ added in v0.1.15
func (*Course) IsOfficial ¶ added in v0.1.15
type CourseVariant ¶ added in v0.0.4
type CourseVariant string
const ( CourseVariantSimple CourseVariant = "simple" CourseVariantModular CourseVariant = "modular" )
type CreateAuthorRequest ¶ added in v0.0.4
type CreateAuthorRequest struct {
Author
}
type CreateChallengeRequest ¶ added in v0.0.4
type CreateCourseRequest ¶ added in v0.0.4
type CreateCourseRequest struct {
Name string `json:"name"`
Variant CourseVariant `json:"variant"`
Sample bool `json:"sample"`
}
type CreatePlayRequest ¶
type CreatePlaygroundRequest ¶ added in v0.1.15
type CreatePlaygroundRequest struct {
Base string `yaml:"base" json:"base"`
Title string `yaml:"title" json:"title"`
Description string `yaml:"description" json:"description"`
Categories []string `yaml:"categories" json:"categories"`
Access PlaygroundAccess `yaml:"access" json:"access"`
Machines []PlaygroundMachine `yaml:"machines" json:"machines"`
Tabs []PlaygroundTab `yaml:"tabs" json:"tabs"`
InitTasks map[string]InitTask `yaml:"initTasks" json:"initTasks"`
InitConditions InitConditions `yaml:"initConditions" json:"initConditions"`
RegistryAuth string `yaml:"registryAuth" json:"registryAuth"`
}
type CreateSkillPathRequest ¶ added in v0.1.5
type CreateTutorialRequest ¶ added in v0.0.4
type InitCondition ¶ added in v0.1.15
type InitConditionValue ¶ added in v0.1.15
type InitConditions ¶ added in v0.1.15
type InitConditions struct {
Values []InitConditionValue `yaml:"values,omitempty" json:"values,omitempty"`
}
type InitTask ¶ added in v0.1.15
type InitTask struct {
Name string `yaml:"name" json:"name"`
Machine string `yaml:"machine,omitempty" json:"machine,omitempty"`
Init bool `yaml:"init" json:"init"`
User string `yaml:"user" json:"user"`
TimeoutSeconds int `yaml:"timeout_seconds" json:"timeout_seconds"`
Needs []string `yaml:"needs,omitempty" json:"needs,omitempty"`
Run string `yaml:"run" json:"run"`
Status int `yaml:"status,omitempty" json:"status,omitempty"`
Conditions []InitCondition `yaml:"conditions,omitempty" json:"conditions,omitempty"`
}
type ListAuthorsFilter ¶ added in v0.0.4
type ListAuthorsFilter struct {
UserID []string
}
type ListChallengesOptions ¶ added in v0.1.0
type ListPlaygroundsOptions ¶ added in v0.1.16
type ListPlaygroundsOptions struct {
Filter string
}
type Machine ¶
type Machine struct {
Name string `json:"name"`
Users []MachineUser `json:"users"`
Resources MachineResources `json:"resources"`
}
func (*Machine) DefaultUser ¶ added in v0.1.0
func (m *Machine) DefaultUser() *MachineUser
type MachineResources ¶ added in v0.1.16
type MachineUser ¶ added in v0.1.0
type Me ¶
type Me struct {
ID string `json:"id" yaml:"userId"`
GithubProfileId string `json:"githubProfileId" yaml:"githubProfileId"`
PremiumAccess *PremiumAccess `json:"premiumAccess,omitempty" yaml:"premiumAccess,omitempty"`
}
type Play ¶
type Play struct {
ID string `json:"id" yaml:"id"`
CreatedAt string `json:"createdAt" yaml:"createdAt"`
UpdatedAt string `json:"updatedAt" yaml:"updatedAt"`
LastStateAt string `json:"lastStateAt" yaml:"lastStateAt"`
ExpiresIn int `json:"expiresIn" yaml:"expiresIn"`
Playground Playground `json:"playground" yaml:"playground"`
TutorialName string `json:"tutorialName,omitempty" yaml:"tutorialName"`
Tutorial *struct {
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
} `json:"tutorial,omitempty" yaml:"tutorial"`
ChallengeName string `json:"challengeName,omitempty" yaml:"challengeName"`
Challenge *struct {
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
} `json:"challenge,omitempty" yaml:"challenge"`
CourseName string `json:"courseName,omitempty" yaml:"courseName"`
Course *struct {
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
} `json:"course,omitempty" yaml:"course"`
LessonPath string `json:"lessonPath,omitempty" yaml:"lessonPath"`
Lesson *struct {
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
} `json:"lesson,omitempty" yaml:"lesson"`
PageURL string `json:"pageUrl" yaml:"pageUrl"`
Active bool `json:"active" yaml:"active"`
Running bool `json:"running" yaml:"running"`
Destroyed bool `json:"destroyed" yaml:"destroyed"`
Failed bool `json:"failed" yaml:"failed"`
Machines []Machine `json:"machines" yaml:"machines"`
Tasks map[string]PlayTask `json:"tasks,omitempty" yaml:"tasks,omitempty"`
}
func (*Play) CountCompletedInitTasks ¶ added in v0.1.15
func (*Play) CountInitTasks ¶ added in v0.1.15
func (*Play) GetMachine ¶
func (*Play) IsCompletable ¶ added in v0.1.15
func (*Play) IsInitialized ¶ added in v0.1.15
type PlayConn ¶ added in v0.1.15
type PlayConn struct {
// contains filtered or unexported fields
}
func NewPlayConn ¶ added in v0.1.15
type PlayConnHandle ¶ added in v0.1.0
type PlayConnHandle struct {
URL string `json:"url"`
}
type PlayConnMessage ¶ added in v0.1.15
type PlayTask ¶ added in v0.1.0
type PlayTask struct {
Name string `json:"name"`
Init bool `json:"init"`
Helper bool `json:"helper"`
Status PlayTaskStatus `json:"status"`
Version int `json:"version"`
}
type PlayTaskStatus ¶ added in v0.1.0
type PlayTaskStatus int
const ( PlayTaskStatusNone PlayTaskStatus = 0 PlayTaskStatusCreated PlayTaskStatus = 10 PlayTaskStatusBlocked PlayTaskStatus = 20 PlayTaskStatusRunning PlayTaskStatus = 30 PlayTaskStatusFailed PlayTaskStatus = 35 PlayTaskStatusCompleted PlayTaskStatus = 40 )
type Playground ¶
type Playground struct {
ID string `yaml:"id" json:"id"`
Owner string `yaml:"owner" json:"owner"`
Name string `yaml:"name" json:"name"`
Base string `yaml:"base" json:"base"`
Title string `yaml:"title" json:"title"`
Description string `yaml:"description" json:"description"`
Categories []string `yaml:"categories" json:"categories"`
Cover string `yaml:"cover,omitempty" json:"cover,omitempty"`
PageURL string `yaml:"pageUrl" json:"pageUrl"`
Access PlaygroundAccess `yaml:"access" json:"access"`
Machines []PlaygroundMachine `yaml:"machines" json:"machines"`
Tabs []PlaygroundTab `yaml:"tabs" json:"tabs"`
InitTasks map[string]InitTask `yaml:"initTasks" json:"initTasks"`
InitConditions InitConditions `yaml:"initConditions" json:"initConditions"`
RegistryAuth string `yaml:"registryAuth,omitempty" json:"registryAuth,omitempty"`
}
type PlaygroundAccess ¶ added in v0.1.15
type PlaygroundMachine ¶ added in v0.1.15
type PlaygroundMachine struct {
Name string `yaml:"name" json:"name"`
Users []MachineUser `yaml:"users" json:"users"`
Resources MachineResources `yaml:"resources" json:"resources"`
}
type PlaygroundManifest ¶ added in v0.1.15
type PlaygroundManifest struct {
Kind string `yaml:"kind" json:"kind"`
Title string `yaml:"title" json:"title"`
Description string `yaml:"description" json:"description"`
Categories []string `yaml:"categories" json:"categories"`
Playground PlaygroundSpec `yaml:"playground" json:"playground"`
}
type PlaygroundSpec ¶ added in v0.1.15
type PlaygroundSpec struct {
Access PlaygroundAccess `yaml:"access" json:"access"`
Machines []PlaygroundMachine `yaml:"machines" json:"machines"`
Tabs []PlaygroundTab `yaml:"tabs" json:"tabs"`
InitTasks map[string]InitTask `yaml:"initTasks" json:"initTasks"`
InitConditions InitConditions `yaml:"initConditions" json:"initConditions"`
RegistryAuth string `yaml:"registryAuth,omitempty" json:"registryAuth,omitempty"`
}
type PlaygroundTab ¶ added in v0.1.15
type PortAccess ¶
type PortAccess string
const ( PortAccessPublic PortAccess = "public" PortAccessPrivate PortAccess = "private" )
type PremiumAccess ¶ added in v0.0.4
type SkillPath ¶ added in v0.1.5
type SkillPath struct {
CreatedAt string `json:"createdAt" yaml:"createdAt"`
UpdatedAt string `json:"updatedAt" yaml:"updatedAt"`
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
PageURL string `json:"pageUrl" yaml:"pageUrl"`
Authors []Author `json:"authors" yaml:"authors"`
}
func (*SkillPath) GetKind ¶ added in v0.1.5
func (t *SkillPath) GetKind() content.ContentKind
func (*SkillPath) GetPageURL ¶ added in v0.1.5
func (*SkillPath) IsAuthoredBy ¶ added in v0.1.15
func (*SkillPath) IsOfficial ¶ added in v0.1.15
type StartChallengeOptions ¶ added in v0.1.15
type StartChallengeOptions struct {
SafetyDisclaimerConsent bool
}
type StartTunnelRequest ¶
type StartTunnelResponse ¶
type Tutorial ¶ added in v0.0.4
type Tutorial struct {
CreatedAt string `json:"createdAt" yaml:"createdAt"`
UpdatedAt string `json:"updatedAt" yaml:"updatedAt"`
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
PageURL string `json:"pageUrl" yaml:"pageUrl"`
Authors []Author `json:"authors" yaml:"authors"`
}
func (*Tutorial) GetKind ¶ added in v0.0.4
func (t *Tutorial) GetKind() content.ContentKind
func (*Tutorial) GetPageURL ¶ added in v0.0.4
func (*Tutorial) IsAuthoredBy ¶ added in v0.1.15
func (*Tutorial) IsOfficial ¶ added in v0.1.15
type UpdatePlaygroundRequest ¶ added in v0.1.15
type UpdatePlaygroundRequest struct {
Title string `yaml:"title" json:"title"`
Description string `yaml:"description" json:"description"`
Categories []string `yaml:"categories" json:"categories"`
Access PlaygroundAccess `yaml:"access" json:"access"`
Machines []PlaygroundMachine `yaml:"machines" json:"machines"`
Tabs []PlaygroundTab `yaml:"tabs" json:"tabs"`
InitTasks map[string]InitTask `yaml:"initTasks" json:"initTasks"`
InitConditions InitConditions `yaml:"initConditions" json:"initConditions"`
RegistryAuth string `yaml:"registryAuth" json:"registryAuth"`
}
Click to show internal directories.
Click to hide internal directories.