Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HTTPResponseCtr allows the counting of Http Responses and their status codes HTTPResponseCtr = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "undergang_http_response_total", Help: "Number of http responses", }, []string{"code"}, ) // BackendActive allows the counting of active (registered) backends BackendActive = prometheus.NewGauge( prometheus.GaugeOpts{ Name: "undergang_backend_active_total", Help: "Number of active backends", }, ) // BackendsRegistered allows the counting of backends that have been registered BackendsRegistered = prometheus.NewCounter( prometheus.CounterOpts{ Name: "undergang_backend_registered_total", Help: "Number of backends that have been registered", }, ) // BackendsStarted allows the counting of backends that have been started BackendsStarted = prometheus.NewCounter( prometheus.CounterOpts{ Name: "undergang_backend_started_total", Help: "Number of backends that have been started", }, ) // BackendsUnregistered allows the counting of backends that have been unregistered BackendsUnregistered = prometheus.NewCounter( prometheus.CounterOpts{ Name: "undergang_backend_unregistered_total", Help: "Number of backends that have been unregistered", }, ) // BackendFailure allows the counting of backends and the corresponding failure reason BackendFailure = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "undergang_backend_failure_total", Help: "Number of backends that have failed", }, []string{"reason"}, ) // BackendReconnectSSH allows the counting of backends that have reconnected to the SSH server BackendReconnectSSH = prometheus.NewCounter( prometheus.CounterOpts{ Name: "undergang_backend_reconnect_ssh_total", Help: "Number of backends that have reconnected to SSH", }, ) // BackendProvisioningDuration allows the histogram of provisioning durations BackendProvisioningDuration = prometheus.NewHistogram( prometheus.HistogramOpts{ Name: "undergang_backend_provisioning_seconds", Help: "Provisioning duration for backends", Buckets: []float64{1, 5, 10, 30, 1 * 60, 2 * 60, 3 * 60, 4 * 60, 5 * 60, 10 * 60, 20 * 60}, }, ) // BackendConnectSSHDuration allows the histogram of provisioning durations BackendConnectSSHDuration = prometheus.NewHistogram( prometheus.HistogramOpts{ Name: "undergang_backend_connect_ssh_seconds", Help: "SSH connection duration for backends", Buckets: []float64{1, 5, 10, 30, 1 * 60, 2 * 60, 3 * 60, 4 * 60, 5 * 60}, }, ) // BackendBootstrapDuration allows the histogram of provisioning durations BackendBootstrapDuration = prometheus.NewHistogram( prometheus.HistogramOpts{ Name: "undergang_backend_bootstrap_seconds", Help: "SSH bootstrap duration for backends", Buckets: []float64{1, 5, 10, 30, 1 * 60, 2 * 60, 3 * 60, 4 * 60, 5 * 60, 10 * 60, 20 * 60}, }, ) )
Functions ¶
func UnregisterBackend ¶
func UnregisterBackend(id int)
UnregisterBackend unregisters a backend from the manager
Types ¶
type Backend ¶
type Backend interface { ID() int Start() IsReady() bool Connect() net.Conn GetInfo() PathInfo Subscribe(chan progressCmd) GetLogger() *logrus.Entry }
Backend represents a tunnel to an app reached by a SSH tunnel
func LookupBackend ¶
LookupBackend looks up a backend given a host and path
func NewBackend ¶
NewBackend instantiates a new backend
type PathInfo ¶
type PathInfo struct { Host string `json:"host"` Prefix string `json:"prefix"` Provisioning *configProvisioning `json:"provisioning"` SSHTunnel *configSSHTunnel `json:"ssh_tunnel"` Backend *configBackend `json:"backend"` StaticOverrides map[string]string `json:"static_overrides"` ProgressPage *configProgressPage `json:"progress_page"` BasicAuth *configBasicAuth `json:"basic_auth"` ServerAuth *configServerAuth `json:"server_auth"` }
PathInfo represents the configuration of a backend
type Signer ¶
type Signer struct { Sep string // contains filtered or unexported fields }
Signer signs a payload
type TimestampSigner ¶
type TimestampSigner struct {
*Signer
}
TimestampSigner signs a message that has to be verified within a duration
func NewTimestampSigner ¶
func NewTimestampSigner(h hash.Hash) *TimestampSigner
NewTimestampSigner creates a new TimestampSigner
func (*TimestampSigner) Sign ¶
func (s *TimestampSigner) Sign(msg string) string
Sign signs a message
func (*TimestampSigner) SignWithTime ¶
func (s *TimestampSigner) SignWithTime(msg string, now int64) string
SignWithTime signs a message with a given timestamp
func (*TimestampSigner) Verify ¶
Verify verifies that the message was signed within the specified duration
func (*TimestampSigner) VerifyWithTime ¶
VerifyWithTime verifies that the message was signed within the specified duration
Click to show internal directories.
Click to hide internal directories.