envy

package
v0.0.0-...-4b60dc3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: MIT Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "envy",
	Short: "",
	Run: func(cmd *cobra.Command, args []string) {
		cmd.Usage()
	},
}
View Source
var Envy = new(EnvyRoot)
View Source
var EnvySocket = "/var/run/envy.sock"

Functions

func CheckAdminCmd

func CheckAdminCmd()

func CheckSystemCmd

func CheckSystemCmd()

func ClientMode

func ClientMode() bool

func RunClient

func RunClient(args []string)

func SetupLogging

func SetupLogging()

Types

type Environ

type Environ struct {
	User    *User
	Name    string
	IDEPort int
}

func GetEnviron

func GetEnviron(user, name string) *Environ

func (*Environ) DockerImage

func (e *Environ) DockerImage() string

func (*Environ) DockerName

func (e *Environ) DockerName() string

func (*Environ) IDE

func (e *Environ) IDE(username, password string) int

func (*Environ) IDEImage

func (e *Environ) IDEImage() string

func (*Environ) IDEName

func (e *Environ) IDEName() string

func (*Environ) Path

func (e *Environ) Path(parts ...string) string

type EnvyRoot

type EnvyRoot struct{}

func (*EnvyRoot) Allow

func (r *EnvyRoot) Allow(user, environ string) bool

func (*EnvyRoot) DataPath

func (r *EnvyRoot) DataPath(parts ...string) string

func (*EnvyRoot) HostPath

func (r *EnvyRoot) HostPath(parts ...string) string

func (*EnvyRoot) Path

func (r *EnvyRoot) Path(parts ...string) string

func (*EnvyRoot) Setup

func (r *EnvyRoot) Setup()

type ExecManager

type ExecManager struct {
	ScriptPath string
}

func (*ExecManager) Exists

func (em *ExecManager) Exists(username string) (bool, error)

func (*ExecManager) NewEnrollment

func (em *ExecManager) NewEnrollment(student *pkg.Student, course *pkg.Course) error

func (*ExecManager) NewStudent

func (em *ExecManager) NewStudent(student *pkg.Student) error

type Server

type Server struct {
	Router      *mux.Router
	Students    pkg.StudentStorage
	Courses     pkg.CourseStorage
	ExecManager *ExecManager
}

func NewServer

func NewServer(students pkg.StudentStorage, courses pkg.CourseStorage) *Server

func (*Server) AddCourse

func (s *Server) AddCourse(w http.ResponseWriter, req *http.Request)

func (*Server) Enroll

func (s *Server) Enroll(w http.ResponseWriter, req *http.Request)

func (*Server) GetStudent

func (s *Server) GetStudent(w http.ResponseWriter, req *http.Request)

func (*Server) ServeEnroll

func (s *Server) ServeEnroll(w http.ResponseWriter, req *http.Request)

type Session

type Session struct {
	User *User
	Name string
}

func GetSession

func GetSession(user, name string) *Session

func NewSession

func NewSession(user string) *Session

func (*Session) Cleanup

func (s *Session) Cleanup()

func (*Session) DockerName

func (s *Session) DockerName() string

func (*Session) Enter

func (s *Session) Enter(environ *Environ) int

func (*Session) Environ

func (s *Session) Environ() *Environ

func (*Session) Path

func (s *Session) Path(parts ...string) string

func (*Session) SetEnviron

func (s *Session) SetEnviron(name string)

type SignupResponse

type SignupResponse struct {
	Error        bool
	ErrorMessage string
	ShellURL     string
	IDEURL       string
	Username     string
}

type User

type User struct {
	Name string
}

func GetUser

func GetUser(name string) *User

func (*User) Admin

func (u *User) Admin() bool

func (*User) Environ

func (u *User) Environ(name string) *Environ

func (*User) Environs

func (u *User) Environs() []string

func (*User) Path

func (u *User) Path(parts ...string) string

func (*User) Session

func (u *User) Session(name string) *Session

Directories

Path Synopsis
internal
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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