Documentation ¶
Index ¶
- Variables
- type Container
- func (oc *Container) GetStream(ctx context.Context) (types.HijackedResponse, error)
- func (oc *Container) ResizeTTY(ctx context.Context, height, width int) error
- func (oc *Container) String() string
- func (oc *Container) WaitForShutdown(ctx context.Context) (<-chan container.ContainerWaitOKBody, <-chan error)
- type ContainerState
- type ContainerStatus
- type ContainerUser
- func (cu *ContainerUser) Activity()
- func (cu *ContainerUser) ActivityChan() <-chan struct{}
- func (cu *ContainerUser) GetContainer() (oc *Container, status ContainerStatus)
- func (cu *ContainerUser) IsAlive() (isAlive bool)
- func (cu *ContainerUser) NotifyConnectionClosed()
- func (cu *ContainerUser) ShutdownDone() <-chan ContainerStatus
- func (cu *ContainerUser) String() string
- type Image
- type ImageKind
- type ImageList
- type User
- type UserList
- func (ul *UserList) GetUser(uid string) (ui *User)
- func (ul *UserList) GetUserByLoginPassword(login, password string) (ui *User, err error)
- func (ul *UserList) GetUserByPubKey(login, publicKey string) (ui *User, err error)
- func (ul *UserList) GetUserByWebToken(tasktoken string) (ui *User, err error)
- func (ul *UserList) GetUserFromSSH(uid string) (ui *User, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Docker *mydocker.Client
View Source
var ImageKinds = []ImageKind{ImageKindWeb, ImageKindSSH, ImageKindTCP}
View Source
var ImageNotAvailibleErr = errors.New("image not availible")
View Source
var ImageNotFoundErr = errors.New("image not found")
View Source
var InactivityTimeoutErr = errors.New("Inactivity Timeout Expired")
View Source
var SessionTimeoutErr = errors.New("Total Timeout Expired")
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct { DockerID string Image *Image // ui *UserIdentity URL *url.URL // contains filtered or unexported fields }
func (*Container) WaitForShutdown ¶
type ContainerState ¶
type ContainerState uint8
const ( ContainerStateDead ContainerState = iota // null value ContainerStateStarting ContainerStateWorking ContainerStateStartErr ContainerStateShutdown ContainerStateShutdownInactivity // user was inactive too long ContainerStateShutdownSessionLen // user was active too long ContainerStateShutdownWithErr ContainerStateShutdownWithErrMsg )
func (ContainerState) String ¶
func (cs ContainerState) String() string
type ContainerStatus ¶
type ContainerStatus struct { ContainerState ContainerState Err error Status int64 }
func (ContainerStatus) String ¶
func (cs ContainerStatus) String() string
type ContainerUser ¶
type ContainerUser struct {
// contains filtered or unexported fields
}
Image.ContainerUsers[UserId.ID] ->ContainerUser (new or cached) (atomically)
func (*ContainerUser) Activity ¶
func (cu *ContainerUser) Activity()
Callback to mark user being active on the container
func (*ContainerUser) ActivityChan ¶
func (cu *ContainerUser) ActivityChan() <-chan struct{}
Callback to mark user being active on the container
func (*ContainerUser) GetContainer ¶
func (cu *ContainerUser) GetContainer() (oc *Container, status ContainerStatus)
returns running container, blocks while container starting
func (*ContainerUser) IsAlive ¶
func (cu *ContainerUser) IsAlive() (isAlive bool)
func (*ContainerUser) NotifyConnectionClosed ¶
func (cu *ContainerUser) NotifyConnectionClosed()
Strictly once after GetContainer
func (*ContainerUser) ShutdownDone ¶
func (cu *ContainerUser) ShutdownDone() <-chan ContainerStatus
func (*ContainerUser) String ¶
func (cu *ContainerUser) String() string
type Image ¶
type Image struct { Kind ImageKind Name string Port int ConcurrentUsers int TotalUsers int DockerID string PersistBetweenReconnects bool Timeouts struct { Total time.Duration Inactive time.Duration } // contains filtered or unexported fields }
func NewImage ¶
func NewImage(jc jobcontroller.JobController, img *mydocker.Image) (*Image, error)
func (*Image) GetContainerUser ¶
func (oi *Image) GetContainerUser(jc jobcontroller.JobController, ui *User) (cu *ContainerUser)
func (*Image) IsVisibleTo ¶
func (*Image) MarkRemoved ¶
func (oi *Image) MarkRemoved()
type ImageList ¶
type ImageList struct {
// contains filtered or unexported fields
}
func NewImageList ¶
func NewImageList(jc jobcontroller.JobController) (il *ImageList, err error)
func (*ImageList) UpdateImages ¶
func (il *ImageList) UpdateImages(jc jobcontroller.JobController) (err error)
type User ¶
type User struct { // login by default ID string // contains filtered or unexported fields }
type UserList ¶
type UserList struct {
// contains filtered or unexported fields
}
func NewUserList ¶
func NewUserList() *UserList
func (*UserList) GetUserByLoginPassword ¶
func (*UserList) GetUserByPubKey ¶
func (*UserList) GetUserByWebToken ¶
todo: task token is looked up in db, not constant time. bad look for CTF framework
func (*UserList) GetUserFromSSH ¶
This is a mess... This func is called with authorized user id via ldap rpc TODO: restructure auth process, decouple auth methods from handlers in main e.g.: web auth also could be performed via login/password
Click to show internal directories.
Click to hide internal directories.