app

package
v0.0.0-...-a3a5c94 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	Address:         "",
	Port:            "8080",
	PermitWrite:     true,
	IndexFile:       "",
	TitleFormat:     "GRTTY Command",
	EnableReconnect: true,
	ReconnectTime:   10,
	CloseSignal:     1,
	SessionKey:      "_auth_user_id",
}

DefaultOptions -

View Source
var ExecuteCommandFailed float64

ExecuteCommandFailed metric

View Source
var ExecuteCommandTotal float64

ExecuteCommandTotal metric

View Source
var Version = "0.0.2"

Version -

Functions

func NewExecContext

func NewExecContext(kubeRequest *restclient.Request, config *restclient.Config) (server.Slave, error)

NewExecContext

func SetConfigDefaults

func SetConfigDefaults(config *rest.Config) error

SetConfigDefaults -

Types

type App

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

App -

func New

func New(options *Options) (*App, error)

New -

func (*App) Exit

func (app *App) Exit() (firstCall bool)

Exit -

func (*App) GetContainerArgs

func (app *App) GetContainerArgs(namespace, podname, containerName string) (string, string, []string, error)

GetContainerArgs get default container name

func (*App) NewRequest

func (app *App) NewRequest(podName, namespace, containerName string, command []string) *restclient.Request

NewRequest new exec request

func (*App) Run

func (app *App) Run() error

Run Run

type Exporter

type Exporter struct {
	ExecuteCommandTotal  prometheus.Counter
	ExecuteCommandFailed prometheus.Counter
}

Exporter collects webcli metrics. It implements prometheus.Collector.

func NewExporter

func NewExporter() *Exporter

NewExporter

func (*Exporter) Collect

func (e *Exporter) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*Exporter) Describe

func (e *Exporter) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

type InitMessage

type InitMessage struct {
	TenantID      string `json:"T_id"`
	ServiceID     string `json:"S_id"`
	PodName       string `json:"C_id"`
	ContainerName string `json:"containerName"`
	Md5           string `json:"Md5"`
}

InitMessage -

type Options

type Options struct {
	Address     string `hcl:"address"`
	Port        string `hcl:"port"`
	PermitWrite bool   `hcl:"permit_write"`
	IndexFile   string `hcl:"index_file"`
	//titile format by golang templete
	TitleFormat     string                 `hcl:"title_format"`
	EnableReconnect bool                   `hcl:"enable_reconnect"`
	ReconnectTime   int                    `hcl:"reconnect_time"`
	PermitArguments bool                   `hcl:"permit_arguments"`
	CloseSignal     int                    `hcl:"close_signal"`
	RawPreferences  map[string]interface{} `hcl:"preferences"`
	SessionKey      string                 `hcl:"session_key"`
	K8SConfPath     string
}

Options options

type Out

type Out struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

Out

func CreateOut

func CreateOut(tty *os.File) *Out

CreateOut

func (*Out) SetTTY

func (o *Out) SetTTY() term.TTY

SetTTY

type WsWrapper

type WsWrapper struct {
	*websocket.Conn
}

WsWrapper

func (*WsWrapper) Read

func (wsw *WsWrapper) Read(p []byte) (n int, err error)

func (*WsWrapper) Write

func (wsw *WsWrapper) Write(p []byte) (n int, err error)

Write

Jump to

Keyboard shortcuts

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