command

package
v0.0.0-...-e9dc8b2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const KontrolInsecureCommandHandlerEnvKey = "TEAMS_KONTROL_INSECURE_COMMANDS"
View Source
const KontrolPermissionFileEnvKey = "TEAMS_KONTROL_PERMISSION_FILE"
View Source
const KontrolResponseTypeEnvKey = "TEAMS_KONTROL_RESPONSE_TYPE"

Variables

This section is empty.

Functions

func ExecuteCommand

func ExecuteCommand(client kubernetes.Interface, command Command) (interface{}, error)

Execute takes a valid command and attempts to execute it returns an interface containing a list of pods, a pod, or an error if it's failed. if nil, nil is returned then the command likely didn't return anything in the first place. i.e. delete

func Handler

func Handler(client kubernetes.Interface, w http.ResponseWriter, r *http.Request)

func Init

func Init()

Init will ensure that there's a Command file. The program will crash if it is not specified.

func PrepareResponse

func PrepareResponse(result interface{}) ([]byte, error)

PrepareResponse takes an interface and attempts to render the appropriate response and returns it as a byte array i.e. if teamsResponseType == "TEAMS" and the interface is a pod then it will return a teams card with the pod details

Types

type Command

type Command struct {
	Verb       string
	Resource   string
	Namespace  string
	Identifier string
}

Jump to

Keyboard shortcuts

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