Documentation ¶
Overview ¶
Package config provides the main configuration for dockerbot
Index ¶
Constants ¶
const ( // DefaultIdleTimeout defines the default time after which a session is terminated DefaultIdleTimeout = 10 * time.Minute // DefaultMaxTotalSessions is the default number of sessions all users are allowed to run concurrently DefaultMaxTotalSessions = 6 // DefaultMaxUserSessions is the default number of sessions a user is allowed to run concurrently DefaultMaxUserSessions = 2 // DefaultRecord defines if sessions are recorded by default DefaultRecord = false // DefaultUploadRecording defines if session recording are uploaded to asciinema DefaultUploadRecording = false // DefaultWeb defines if sessions have a web terminal by default DefaultWeb = false )
const ( Slack = Platform("slack") Discord = Platform("discord") Mem = Platform("mem") )
All possible Platform constants
const ( DefaultControlMode = Split Thread = ControlMode("thread") Channel = ControlMode("channel") Split = ControlMode("split") )
All possible ControlMode constants
const ( DefaultWindowMode = Full Full = WindowMode("full") Trim = WindowMode("trim") )
All possible WindowMode constants
const ( DefaultAuthMode = Everyone OnlyMe = AuthMode("only-me") Everyone = AuthMode("everyone") )
All possible AuthMode constants
const ( CursorOff = time.Duration(0) CursorOn = time.Duration(1) )
Constants used to toggle the cursor on or off
Variables ¶
var ( Tiny = &Size{"tiny", 60, 15} Small = &Size{"small", 80, 24} Medium = &Size{"medium", 100, 30} Large = &Size{"large", 120, 38} DefaultSize = Small Sizes = map[string]*Size{ Tiny.Name: Tiny, Small.Name: Small, Medium.Name: Medium, Large.Name: Large, } )
All possible Size constants
Functions ¶
This section is empty.
Types ¶
type AuthMode ¶
type AuthMode string
AuthMode defines who is allowed to interact with the session by default
type Config ¶
type Config struct { Token string ScriptDir string IdleTimeout time.Duration MaxTotalSessions int MaxUserSessions int DefaultControlMode ControlMode DefaultWindowMode WindowMode DefaultAuthMode AuthMode DefaultSize *Size DefaultWeb bool WebHost string DefaultRecord bool UploadRecording bool Cursor time.Duration RefreshInterval time.Duration Debug bool }
Config is the main config struct for the application. Use New to instantiate a default config struct.
func (*Config) Script ¶
Script returns the path to the script with the given name. If a script with the given name does not exist, the result may be empty.
func (*Config) ShareEnabled ¶
ShareEnabled returns true if the share features is enabled
type ControlMode ¶
type ControlMode string
ControlMode defines where the control channel and where the terminal will be opened, see config.yml for details
type Size ¶
Size defines the dimensions of the terminal
type WindowMode ¶
type WindowMode string
WindowMode defines whether white spaces are trimmed from the terminal