Podwizzard_GO

package module
v0.0.0-...-124dcec Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 6 Imported by: 0

README

go_podwiz

Go package for Podwizzard_GO

Usage

You must run client before connecting to it!

Make sure that the shell you ran podwiz_client into is pointing to the same docker-daemon as that of k8s

import "github.com/Wodlfvllf/Podwizzard_GO"

func main() {
	c := Podwizzard_GO.Connect()
	creds := c.Start(name, machineName, path, imgName, timeToKill, scheduleName)
	list := c.List(scheduleName) // scheduleName doesn't affect for now, you can pass empty string
}

name must be same as the username in Dockerfile. (see how Dockerfile should look like)

machineName is the name you want to give your shell.

path is path of a directory with Dockerfile and a pod.yaml file (see chall-1)

imgName name of the image to be used for shell (If image is not found, image is built using the Dockerfile in path)

timeToKill is the amount of time (secs) after which you want to delete the shell

scheduleName is the name you want to assign the scheduler (development for unique schedule name is in progress, for now you can use same schedule names)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creds

type Creds struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Port     uint16 `json:"ports"`
}

type Received

type Received struct {
	Command string `json:command`
	Data    []byte `json:data`
}

type ScheduleInfo

type ScheduleInfo struct {
	StartTime string `json:startTime`
	EndTime   string `json:endTime`
	Name      string `json:name`
	PodName   string `json:podName`
}

type Socket

type Socket struct {
	Socket *net.Conn
}

func Connect

func Connect() *Socket

func (*Socket) List

func (socket *Socket) List(scheduleName string) []byte

func (*Socket) Start

func (socket *Socket) Start(name string, machineName string, path string, imgName string, time int, scheduleName string) []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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