cmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Copyright © 2021 Srihari Vishnu srihari.vishnu@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021 Srihari Vishnu srihari.vishnu@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021 Srihari Vishnu srihari.vishnu@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021 SRIHARI VISHNU srihari.vishnu@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021 Srihari Vishnu srihari.vishnu@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const HIDDEN_DIRECTORY = ".dockbox"
View Source
const PREFIX = "dockbox"

Variables

View Source
var ExtensionToLanguage = map[string]string{}/* 798 elements not displayed */

https://github.com/jonschlinkert/lang-map/blob/master/lib/exts.json

View Source
var IgnoredFilesForAnalysis = []string{".git/*"}
View Source
var LanguageToImageMapper = map[string]Image{
	"python": {
		"python:3.8-slim-buster",
		[]string{"pip install -r requirements.txt"},
		"/bin/bash",
	},
	"javascript": {
		"node:14",
		[]string{"npm install"},
		"/bin/bash",
	},
	"c++": {
		"ubuntu:18.04",
		[]string{"apt-get update && apt-get install -y build-essential"},
		"/bin/bash",
	},
	"c": {
		"ubuntu:18.04",
		[]string{"apt-get update && apt-get install -y build-essential"},
		"/bin/bash",
	},
	"java": {
		"openjdk:7",
		[]string{},
		"/bin/bash",
	},
	"go": {
		"golang:1.16.5-buster",
		[]string{},
		"/bin/bash",
	},
	"unknown": {
		"ubuntu:18.04",
		[]string{},
		"/bin/bash",
	},
}

Functions

func CheckError

func CheckError(err error)

func Execute

func Execute()

func GetUserBoolean

func GetUserBoolean(prompt string, a ...interface{}) (bool, error)

func GetUserString

func GetUserString(prompt string, a ...interface{}) (string, error)

func NewCleanCommand

func NewCleanCommand(cli dockerClient) *cobra.Command

func NewCreateCommand

func NewCreateCommand(cli dockerClient) *cobra.Command

createCmd represents the create command

func NewEnterCommand

func NewEnterCommand(cli dockerClient) *cobra.Command

enterCmd represents the enter command

func NewListCommand

func NewListCommand(cli dockerClient) *cobra.Command

func NewRootCmd

func NewRootCmd(cli dockerClient) *cobra.Command

rootCmd represents the base command when called without any subcommands

func NewTreeCommand

func NewTreeCommand(cli dockerClient) *cobra.Command

treeCmd represents the tree command

func RunCleanCommand

func RunCleanCommand(cli dockerClient, cleanOptions CleanOptions) error

func RunCreateCommand

func RunCreateCommand(cli dockerClient, createOptions CreateOptions) error

func RunEnterCommand

func RunEnterCommand(cli dockerClient, enterOptions EnterOptions) error

func RunListCommand

func RunListCommand(cli dockerClient, listOptions ListOptions) (string, error)

func RunTreeCommand

func RunTreeCommand(cli dockerClient, treeOptions TreeOptions) error

func SetUpStreamer

func SetUpStreamer(resp types.HijackedResponse) hijackedIOStreamer

Types

type ByValue

type ByValue []Pair

func (ByValue) Len

func (a ByValue) Len() int

func (ByValue) Less

func (a ByValue) Less(i, j int) bool

func (ByValue) Swap

func (a ByValue) Swap(i, j int)

type CleanOptions

type CleanOptions struct {
	// contains filtered or unexported fields
}

type CreateOptions

type CreateOptions struct {
	// contains filtered or unexported fields
}

type EnterOptions

type EnterOptions struct {
	// contains filtered or unexported fields
}

type ForestPrintOptions

type ForestPrintOptions struct {
	// contains filtered or unexported fields
}

type Image

type Image struct {
	Image      string
	Commands   []string
	EntryPoint string
}

func (Image) String

func (i Image) String() string

type ImageForest

type ImageForest struct {
	IDToNode map[string]*ImageNode
	// contains filtered or unexported fields
}

func (*ImageForest) PrintForest

func (forest *ImageForest) PrintForest(printOptions ForestPrintOptions)

type ImageNode

type ImageNode struct {
	ID string
	// contains filtered or unexported fields
}

func (*ImageNode) PrintTree

func (node *ImageNode) PrintTree(printOptions ForestPrintOptions)

type ListOptions

type ListOptions struct {
	// contains filtered or unexported fields
}

type Pair

type Pair struct {
	Key   string
	Value int
}

For sorting map

func SortMap

func SortMap(m map[string]int) []Pair

func (Pair) String

func (p Pair) String() string

type TreeOptions

type TreeOptions struct {
	All bool
}

Jump to

Keyboard shortcuts

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