1 Star 0 Fork 0

infrastlabs / fk-container-web-tty

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.go 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
wrfly 提交于 2020-03-28 16:56 . refactor: always share but control write
package config
import "time"
var SHELL_LIST = [...]string{
"/bin/bash",
"/bin/ash",
"/bin/sh",
}
type DockerConfig struct {
DockerHost string // default is /var/run/docker.sock
PsOptions string
}
type KubeConfig struct {
ConfigPath string // normally is $HOME/.kube/config
}
type GRPCConfig struct {
Servers []string
Auth string
Proxy string // http or socks5
}
type BackendConfig struct {
Type string // docker or kubectl (for now)
Docker DockerConfig
Kube KubeConfig
GRPC GRPCConfig
}
type ControlConfig struct {
Enable bool
All bool
Start bool
Stop bool
Restart bool
}
type ServerConfig struct {
Address string
Port int
GrpcPort int
IdleTime time.Duration
Credential string
EnableReconnect bool
ReconnectTime int
MaxConnection int
WSOrigin string
Term string `default:"xterm"`
ShowLocation bool
Collaborate bool
// audit
EnableAudit bool
AuditLogDir string `default:"log"`
Control ControlConfig
// EnableBasicAuth bool `default:"false"`
// Once bool `default:"false"`
// TitleVariables map[string]interface{}
}
type Config struct {
Debug bool
Backend BackendConfig
Server ServerConfig
}
func New() *Config {
return &Config{
Backend: BackendConfig{
Docker: DockerConfig{},
Kube: KubeConfig{},
GRPC: GRPCConfig{
Servers: []string{},
},
},
Server: ServerConfig{
Control: ControlConfig{},
},
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/infrastlabs/fk-container-web-tty.git
git@gitee.com:infrastlabs/fk-container-web-tty.git
infrastlabs
fk-container-web-tty
fk-container-web-tty
v0.2.6

搜索帮助

344bd9b3 5694891 D2dac590 5694891