app

package
v5.2.0-release+incompa... Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: LGPL-3.0 Imports: 34 Imported by: 6

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 new exec Context

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) GetDefaultContainerName

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

GetDefaultContainerName 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 new a exporter

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"`
	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 out

func CreateOut

func CreateOut(tty *os.File) *Out

CreateOut create out

func (*Out) SetTTY

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

SetTTY set tty

type WsWrapper

type WsWrapper struct {
	*websocket.Conn
}

WsWrapper ws wrapper

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 write

Jump to

Keyboard shortcuts

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