Documentation ¶
Index ¶
- func AddTrackContainer(d *docker.DockerVM, ipAddress string) error
- func CheckID(ID string) (string, error)
- func GetServerPort(IpAddress string) (string, error)
- func GetSpecs(IP string) (*server.SysInfo, error)
- func PrettyPrint(data interface{})
- func RemoveContainerGroups(ContainerID string) error
- func RemoveContianer(IP string, ID string) error
- func RemoveGroup(GroupID string) error
- func RemoveTrackedContainer(id string) error
- func StartContainer(IP string, NumPorts int, GPU bool, ContainerName string) (*docker.DockerVM, error)
- func UpdateIpTable(IpAddress string, serverPort string) error
- func UpdateIpTableListClient() error
- func UploadMultipartFile(client http.Client, uri, key, path string) ([]byte, error)
- func ViewContainers(IP string) (*docker.DockerContainers, error)
- type Group
- type Groups
- type TrackContainer
- type TrackContainers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTrackContainer ¶
AddTrackContainer Adds new container which has been added to the track container
func GetServerPort ¶
GetServerPort Helper function to do find out server port information
func GetSpecs ¶
GetSpecs Gets Specs from the server such CPU, GPU usage and other basic information which helps set a cluster of computer
func PrettyPrint ¶
func PrettyPrint(data interface{})
PrettyPrint print the contents of the obj ( Reference: https://stackoverflow.com/questions/24512112/how-to-print-struct-variables-in-console
func RemoveContainerGroups ¶
RemoveContainerGroups Remove Container from groups (i.e which ever groups has information about that container). This is mostly called when a container is deleted or removed from the tracked container list
func RemoveContianer ¶
RemoveContianer Stops and removes container from the server
func RemoveGroup ¶
RemoveGroup Removes group based on the group ID provided
func RemoveTrackedContainer ¶
RemoveTrackedContainer This function removos tracked container from the trackcontainer JSON file
func StartContainer ¶
func StartContainer(IP string, NumPorts int, GPU bool, ContainerName string) (*docker.DockerVM, error)
StartContainer Start container using REST api Implementation From the selected server IP address TODO: Test cases for this function Calls URL ex: http://0.0.0.0:8088/startcontainer?ports=0&GPU=false&ContainerName=docker-ubuntu-sshd
func UpdateIpTable ¶
UpdateIpTable Does the following to update it's IP table
func UpdateIpTableListClient ¶
func UpdateIpTableListClient() error
UpdateIpTableListClient updates IP tables (Default 3 hops) based on server information available on the ip tables
func UploadMultipartFile ¶
func ViewContainers ¶
func ViewContainers(IP string) (*docker.DockerContainers, error)
ViewContainers This function displays all containers available on server side
Types ¶
type Group ¶
type Group struct { ID string `json:"ID"` TrackContainerList []*TrackContainer `json:"TrackContainer"` // contains filtered or unexported fields }
Group Information about a single group
func AddContainerToGroup ¶
AddContainerToGroup Adds container information to the Group based on the Group ID
func CreateGroup ¶
CreateGroup Creates a new group to add a set of track containers
func RemoveContainerGroup ¶
RemoveContainerGroup Remove Container from the group ID specified
func (*Group) AddContainer ¶
func (grp *Group) AddContainer(Container *TrackContainer) error
AddContainer Adds a container to the Tracked container list of the group
func (*Group) AddGroupToFile ¶
AddGroupToFile Adds Group struct to the GroupTrackContainer File
func (*Group) RemoveContainerGroup ¶
func (grp *Group) RemoveContainerGroup(Container *TrackContainer) error
RemoveContainerGroup Removes container information from the group
type Groups ¶
type Groups struct {
GroupList []*Group `json:"Groups"`
}
Groups Data Structure type
func (*Groups) RemoveContainerGroups ¶
func (grp *Groups) RemoveContainerGroups(Container *TrackContainer) error
RemoveContainerGroups removes container found in all groups
func (*Groups) WriteGroup ¶
WriteGroup Function to write type Groups to the grouptrackcontainers.json file
type TrackContainer ¶
type TrackContainer struct { Id string `json:"ID"` Container *docker.DockerVM `json:"Container"` IpAddress string `json:"IpAddress"` }
TrackContainer Stores information of current containers
func GetContainerInformation ¶
func GetContainerInformation(ID string) (*TrackContainer, error)
GetContainerInformation gets information about container based on container ID provided
func (*TrackContainer) ModifyContainerGroups ¶
func (TC *TrackContainer) ModifyContainerGroups() error
ModifyContainerGroups Modifies container information is all groups available
func (*TrackContainer) ModifyContainerInformation ¶
func (TC *TrackContainer) ModifyContainerInformation() error
ModifyContainerInformation Modifies information inside the container
type TrackContainers ¶
type TrackContainers struct {
TrackContainerList []TrackContainer `json:"TrackContainer"`
}
TrackContainers This struct stores arrays of current containers running
func ReadTrackContainers ¶
func ReadTrackContainers(filename string) (*TrackContainers, error)
ReadTrackContainers Reads containers which are currently tracked
func ViewTrackedContainers ¶
func ViewTrackedContainers() (error, *TrackContainers)
ViewTrackedContainers View Containers currently tracked
func (*TrackContainers) WriteContainers ¶
func (TC *TrackContainers) WriteContainers() error
WriteContainers Write information back to the config file