base package server created

This commit is contained in:
2021-01-20 19:04:24 +04:00
parent b69270a27d
commit 6b7abe989d
8 changed files with 50 additions and 25 deletions

Binary file not shown.

View File

@@ -4,6 +4,6 @@ import (
"fmt"
)
func server() {
func Servers() {
fmt.Print("here")
}

View File

@@ -1,4 +1,4 @@
package main
/*package server
import (
"context"
@@ -15,7 +15,7 @@ import (
/* creates continer
TODO: Function inputs , outputs to be modified
*/
func create_container() (error, string){
ctx := context.Background()
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
@@ -46,7 +46,7 @@ func create_container() (error, string){
return nil, string(resp.ID)
}
/* returns all containers running */
/* returns all containers running
func containers_running()(error, []types.Container){
ctx := context.Background()
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
@@ -62,7 +62,7 @@ func containers_running()(error, []types.Container){
return nil ,containers
}
/* function to remove container from running */
/* function to remove container from running
func delete_container(container_id string) (error, string){
ctx := context.Background()
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
@@ -82,4 +82,4 @@ func main(){
fmt.Println(container_id)
//_, status := delete_container(container_id)
//fmt.Println(status)
}
} */

View File

@@ -1,4 +1,4 @@
package main
/*package server
import (
"net"
@@ -25,4 +25,4 @@ func main() {
}
log.Println("Shutting down.")
}
}*/

View File

@@ -1,5 +1,4 @@
package main
/*package server
import (
"fmt"
@@ -20,4 +19,4 @@ func main() {
return
}
fmt.Printf("External IP address: %v\n", response.ExternalIPAddress)
}
}*/