app

package
v0.0.0-...-2d91164 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthEndpoint         = "/health"
	RequestTrackingHistory = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatOps

type ChatOps struct {
	Kafka                  bool   `envconfig:"KAFKA"`
	SlackAppId             string `envconfig:"SLACK_APP_ID"`
	SlackVerificationToken string `envconfig:"SLACK_VFY_TOKEN"`
	SlackSecretSigningKey  string `envconfig:"SLACK_SECRET_SIGNING_KEY"`
	SlackClientId          string `envconfig:"SLACK_CLIENT_ID"`
	SlackClientSecret      string `envconfig:"SLACK_CLIENT_SECRET"`
	SlackAuthRedirectUrl   string `envconfig:"SLACK_AUTH_REDIRECT_URL"`
	//SlackToken             string `envconfig:"SLACK_TOKEN"`
	//SlackInHook            string `envconfig:"SLACK_IN_HOOK"`
	FeedbackTopic    string `envconfig:"FEEDBACK_TOPIC"`
	Port             int    `envconfig:"PORT"`
	ElasticSearchUrl string `envconfig:"ELASTICSEARCH_URL"`
	ViewUrl          string `envconfig:"VIEW_URL"`
	HealthUrl        string `envconfig:"HEALTH_URL"`
	TemplateDir      string `envconfig:"TEMPLATE_DIR"`
	RelayPort        int    `envconfig:"RELAY_PORT"`
	RelayHost        string `envconfig:"RELAY_HOST"`
	RelayPassthrough bool   `envconfig:"RELAY_PASSTHROUGH"`
	RelayHandler     bool   `envconfig:"RELAY_HANDLER"`
	RelayCertFile    string `envconfig:"RELAY_CERT_FILE"`
	RelayKeyFile     string `envconfig:"RELAY_KEY_FILE"`
	RelayInsecure    bool   `envconfig:"RELAY_INSECURE"`
	RelayWhiteList   string `envconfig:"RELAY_WHITELIST"`
	DbFile           string `envconfig:"DB_FILE"`
	Debug            bool   `envconfig:"DEBUG"`

	Info build.Info
	// contains filtered or unexported fields
}

TODO:(smt) Config to toggle OnDemandTemplates

func NewChatOps

func NewChatOps(name string) *ChatOps

func (*ChatOps) ChatOpsHandler

func (c *ChatOps) ChatOpsHandler(w http.ResponseWriter, r *http.Request)

ChatOpsHandler handles requests to the general service.

func (*ChatOps) EnvironmentParams

func (c *ChatOps) EnvironmentParams() map[string]string

func (*ChatOps) InitDb

func (c *ChatOps) InitDb()

func (*ChatOps) InitHealth

func (c *ChatOps) InitHealth(prefix, brokers string)

InitHealth creates, initializes, and starts the health reporter

func (*ChatOps) InitKafka

func (c *ChatOps) InitKafka()

func (*ChatOps) InitRelay

func (c *ChatOps) InitRelay()

func (*ChatOps) InitSlack

func (c *ChatOps) InitSlack()

InitSlack initializes the slack sub-component

func (*ChatOps) KafkaProduce

func (c *ChatOps) KafkaProduce(topic, message string)

KafkaProduce is a mechanism for allowing subcomponents to send messages to kafka, without exposing the underlying channel

func (*ChatOps) Run

func (c *ChatOps) Run()

Run is the main entry point for ChatOps

func (*ChatOps) SetFlags

func (c *ChatOps) SetFlags()

func (*ChatOps) StartRelay

func (c *ChatOps) StartRelay()

func (*ChatOps) StartServer

func (c *ChatOps) StartServer()

StartServer starts the application web server

func (*ChatOps) StartSignalHandler

func (c *ChatOps) StartSignalHandler()

func (*ChatOps) StartStatusUpdater

func (c *ChatOps) StartStatusUpdater(interval time.Duration)

StartStatusUpdater provides a continual loop for updating application health data.

type KafkaMessage

type KafkaMessage struct {
	Topic   string
	Message string
}

func (KafkaMessage) String

func (k KafkaMessage) String() string

Jump to

Keyboard shortcuts

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