Documentation ¶
Index ¶
- Constants
- func ContainerAttach(cr *ContextRouter, c *gin.Context)
- func ContainerExec(cr *ContextRouter, c *gin.Context)
- func ContainerKill(cr *ContextRouter, c *gin.Context)
- func ContainerLogs(cr *ContextRouter, c *gin.Context)
- func ContainerRename(cr *ContextRouter, c *gin.Context)
- func ContainerResize(cr *ContextRouter, c *gin.Context)
- func ContainerRestart(cr *ContextRouter, c *gin.Context)
- func ContainerStart(cr *ContextRouter, c *gin.Context)
- func ContainerStop(cr *ContextRouter, c *gin.Context)
- func ExecInfo(cr *ContextRouter, c *gin.Context)
- func ExecResize(cr *ContextRouter, c *gin.Context)
- func ExecStart(cr *ContextRouter, c *gin.Context)
- func GetArchive(cr *ContextRouter, c *gin.Context)
- func HeadArchive(cr *ContextRouter, c *gin.Context)
- func ImageJSON(cr *ContextRouter, c *gin.Context)
- func ImageList(cr *ContextRouter, c *gin.Context)
- func PutArchive(cr *ContextRouter, c *gin.Context)
- func StartContainer(cr *ContextRouter, tainr *types.Container) error
- func UpdateContainerStatus(cr *ContextRouter, tainr *types.Container)
- type Config
- type ContainerExecRequest
- type ContextRouter
- type ExecStartRequest
Constants ¶
const ( // PollRate defines maximum polling request per second towards the backend PollRate = 1 // PollBurst defines maximum burst poll requests towards the backend PollBurst = 3 )
Variables ¶
This section is empty.
Functions ¶
func ContainerAttach ¶
func ContainerAttach(cr *ContextRouter, c *gin.Context)
ContainerAttach - attach to a container to read its output or send input. https://docs.docker.com/engine/api/v1.41/#operation/ContainerAttach https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerAttachLibpod POST "/containers/:id/attach" POST "/libpod/containers/:id/attach"
func ContainerExec ¶
func ContainerExec(cr *ContextRouter, c *gin.Context)
ContainerExec - create an exec instance. https://docs.docker.com/engine/api/v1.41/#operation/ContainerExec https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/exec/operation/ContainerExecLibpod POST "/containers/:id/exec" POST "/libpod/containers/:id/exec"
func ContainerKill ¶
func ContainerKill(cr *ContextRouter, c *gin.Context)
ContainerKill - kill a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerKill https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerKillLibpod POST "/containers/:id/kill" POST "/libpod/containers/:id/kill"
func ContainerLogs ¶
func ContainerLogs(cr *ContextRouter, c *gin.Context)
ContainerLogs - get container logs. https://docs.docker.com/engine/api/v1.41/#operation/ContainerLogs POST "/containers/:id/logs"
func ContainerRename ¶
func ContainerRename(cr *ContextRouter, c *gin.Context)
ContainerRename - rename a container. https://docs.docker.com/engine/api/v1.41/#tag/Container/operation/ContainerRename https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerRenameLibpod GET "/containers/:id/rename" GET "/libpod/containers/:id/rename"
func ContainerResize ¶
func ContainerResize(cr *ContextRouter, c *gin.Context)
ContainerResize - resize the tty for a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerResize https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerResizeLibpod POST "/containers/:id/rezise" POST "/libpod/containers/:id/rezise"
func ContainerRestart ¶
func ContainerRestart(cr *ContextRouter, c *gin.Context)
ContainerRestart - restart a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerRestart https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerRestartLibpod POST "/containers/:id/restart" POST "/libpod/containers/:id/restart"
func ContainerStart ¶
func ContainerStart(cr *ContextRouter, c *gin.Context)
ContainerStart - start a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerStart https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerStartLibpod POST "/containers/:id/start" POST "/libpod/containers/:id/start"
func ContainerStop ¶
func ContainerStop(cr *ContextRouter, c *gin.Context)
ContainerStop - stop a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerStop https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/ContainerStopLibpod POST "/containers/:id/stop" POST "/libpod/containers/:id/stop"
func ExecInfo ¶
func ExecInfo(cr *ContextRouter, c *gin.Context)
ExecInfo - return low-level information about an exec instance. https://docs.docker.com/engine/api/v1.41/#operation/ExecInspect https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/exec/operation/ExecInspectLibpod GET "/exec/:id/json" GET "/libpod/exec/:id/json"
func ExecResize ¶
func ExecResize(cr *ContextRouter, c *gin.Context)
ExecResize - start an exec instance. https://docs.docker.com/engine/api/v1.41/#operation/ExecResize https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/exec/operation/ExecResizeLibpod POST "/exec/:id/resize" POST "/libpod/exec/:id/resize"
func ExecStart ¶
func ExecStart(cr *ContextRouter, c *gin.Context)
ExecStart - start an exec instance. https://docs.docker.com/engine/api/v1.41/#operation/ExecStart POST "/exec/:id/start"
func GetArchive ¶
func GetArchive(cr *ContextRouter, c *gin.Context)
GetArchive - get a tar archive of a resource in the filesystem of container id. https://docs.docker.com/engine/api/v1.41/#operation/ContainerArchive GET "/containers/:id/archive" GET "/libpod/containers/:id/archive"
func HeadArchive ¶
func HeadArchive(cr *ContextRouter, c *gin.Context)
HeadArchive - get information about files in a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerArchiveInfo HEAD "/containers/:id/archive" HEAD "/libpod/containers/:id/archive"
func ImageJSON ¶
func ImageJSON(cr *ContextRouter, c *gin.Context)
ImageJSON - return low-level information about an image. https://docs.docker.com/engine/api/v1.41/#operation/ImageInspect GET "/images/:image/json"
func ImageList ¶
func ImageList(cr *ContextRouter, c *gin.Context)
ImageList - list Images. Stubbed, not relevant on k8s. https://docs.docker.com/engine/api/v1.41/#operation/ImageList https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/images/operation/ImageListLibpod GET "/images/json" GET "/libpod/images/json"
func PutArchive ¶
func PutArchive(cr *ContextRouter, c *gin.Context)
PutArchive - extract an archive of files or folders to a directory in a container. https://docs.docker.com/engine/api/v1.41/#operation/PutContainerArchive https://docs.podman.io/en/latest/_static/api.html?version=v4.2#tag/containers/operation/PutContainerArchiveLibpod PUT "/containers/:id/archive" PUT "/libpod/containers/:id/archive"
func StartContainer ¶
func StartContainer(cr *ContextRouter, tainr *types.Container) error
StartContainer will start given container and saves the appropriate state in the database.
func UpdateContainerStatus ¶
func UpdateContainerStatus(cr *ContextRouter, tainr *types.Container)
UpdateContainerStatus will check if the started container is finished and will update the container database record accordingly.
Types ¶
type Config ¶
type Config struct { // Inspector specifies if the image inspect feature is enabled Inspector bool // PortForward specifies if the the services should be port-forwarded PortForward bool // ReverseProxy enables a reverse-proxy to the services via 0.0.0.0 on the kubedock host ReverseProxy bool // RequestCPU contains an optional default k8s cpu request RequestCPU string // RequestMemory contains an optional default k8s memory request RequestMemory string // RunasUser contains the UID to run pods as RunasUser string // PullPolicy contains the default pull policy for images PullPolicy string // PreArchive will enable copying files without starting containers PreArchive bool // ServiceAccount contains the service account name to be used for running containers ServiceAccount string // ActiveDeadlineSeconds contains the active deadline seconds to be used for running containers ActiveDeadlineSeconds int64 // NamePrefix contains a prefix for the names used for the container deployments (optional). NamePrefix string // NodeSelector contains a comma-separated list of key=value pairs that is used to schedule pods to specific nodes NodeSelector string }
Config is the structure to instantiate a Router object
type ContainerExecRequest ¶
type ContainerExecRequest struct { Cmd []string `json:"Cmd"` Stdin bool `json:"AttachStdin"` Stdout bool `json:"AttachStdout"` Stderr bool `json:"AttachStderr"` Tty bool `json:"Tty"` Env []string `json:"Env"` }
ContainerExecRequest represents the json structure that is used for the /conteiner/:id/exec request.
type ContextRouter ¶
type ContextRouter struct { Config Config DB *model.Database Backend backend.Backend Events events.Events Limiter *rate.Limiter }
ContextRouter is the object that contains shared context for the kubedock API endpoints.
func NewContextRouter ¶
func NewContextRouter(kub backend.Backend, cfg Config) (*ContextRouter, error)
NewContextRouter will instantiate a ContextRouter object.
type ExecStartRequest ¶
ExecStartRequest represents the json structure that is used for the /exec/:id/start request.