lib

package
v2.0.0-...-54ff1d7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetWebhookExecTaskConfigMap

func SetWebhookExecTaskConfigMap(config *WebhooksConfig, configMap map[string]genericexec.GenericExecConfig)

Types

type AppConfig

type AppConfig struct {
	BindAddress            string
	LogFile                string
	HttpAuth               *HttpAuthConfig
	ProvisionAuth          *HttpAuthConfig
	PuppetExecutable       string
	PuppetConfDir          string
	PuppetConfig           *puppetconfig.PuppetConfig
	NodesDir               string
	NodesPrivateKey        string
	NodesGitUser           string
	GenericExecTasks       []*genericexec.GenericExecConfig
	GithubWebhooks         *WebhooksConfig
	ClassifyWebhookTimeout int64
	ClassifyExecTimeout    int64
	NodeConfigTimeout      int64
	DumpHeaders            bool

	Notifications []*NotificationsConfig
	Log           *log.Logger
	// contains filtered or unexported fields
}

func LoadTheConfig

func LoadTheConfig(configName string, configPaths []string) AppConfig

func (*AppConfig) MoveLoggingToFile

func (ctx *AppConfig) MoveLoggingToFile()

type ExecListener

type ExecListener struct {
	Event      string
	Secret     string
	ExecConfig genericexec.GenericExecConfig
}

func StandardR10kListenerConfig

func StandardR10kListenerConfig(config *WebhooksConfig) ExecListener

type GithubWebhookHttpHandler

type GithubWebhookHttpHandler struct {
	ResultChan chan githubwebhook.GitHubWebhookResult
	// contains filtered or unexported fields
}

func NewGithubWebhookHttpHandler

func NewGithubWebhookHttpHandler(config *WebhooksConfig, execManager genericexec.GenericExecManagerInterface, log *log.Logger) *GithubWebhookHttpHandler

func (*GithubWebhookHttpHandler) ServeHTTP

func (ctx *GithubWebhookHttpHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)

type HandlerWrapper

type HandlerWrapper struct {
	// contains filtered or unexported fields
}

func (*HandlerWrapper) ServeHTTP

func (h *HandlerWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HttpAuthConfig

type HttpAuthConfig struct {
	Type   string
	Realm  string
	DbFile string
}

type HttpProtectionMiddlewareFactory

type HttpProtectionMiddlewareFactory struct {
	// contains filtered or unexported fields
}

func NewHttpProtectionMiddlewareFactory

func NewHttpProtectionMiddlewareFactory(config *HttpAuthConfig) HttpProtectionMiddlewareFactory

func (*HttpProtectionMiddlewareFactory) ServeHTTP

func (ctx *HttpProtectionMiddlewareFactory) ServeHTTP(response http.ResponseWriter, request *http.Request)

func (*HttpProtectionMiddlewareFactory) WrapInProtectionMiddleware

func (ctx *HttpProtectionMiddlewareFactory) WrapInProtectionMiddleware(nestedHandler http.Handler) http.Handler

type HttpServer

type HttpServer struct {
	ResultChans, ListenerChans []reflect.SelectCase
	StartChan                  chan struct{}
	// contains filtered or unexported fields
}

func NewHttpServer

func NewHttpServer(config AppConfig, notifier *Notifications, certSigner *certsign.CertSigner, execManager *genericexec.GenericExecManager, nodeClassifier *nodeconfig.NodeClassifier, stopChan chan os.Signal) *HttpServer

func (*HttpServer) Shutdown

func (c *HttpServer) Shutdown(ctx context.Context) error

func (*HttpServer) Start

func (c *HttpServer) Start()

type NodeConfigHandler

type NodeConfigHandler struct {
	// contains filtered or unexported fields
}

func NewNodeConfigHandler

func NewNodeConfigHandler(appConfig *AppConfig, certSigner certsign.CertSignerInterface, nodeClassifier nodeconfig.NodeClassifierInterface) *NodeConfigHandler

func (NodeConfigHandler) ServeHTTP

func (ctx NodeConfigHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)

type Notifications

type Notifications struct {
	// contains filtered or unexported fields
}

func NewNotifications

func NewNotifications(config *AppConfig) *Notifications

func (*Notifications) Notify

func (ctx *Notifications) Notify(message string)

type NotificationsConfig

type NotificationsConfig struct {
	Type       string
	IrcConfig  *irc.Config
	SlackToken *string
	Webhooks   []string
}

type ProvisionHttpHandler

type ProvisionHttpHandler struct {
	// contains filtered or unexported fields
}

func NewProvisionHttpHandler

func NewProvisionHttpHandler(appConfig *AppConfig, notifier *Notifications, certSigner *certsign.CertSigner, execManager *genericexec.GenericExecManager, nodeClassifier *nodeconfig.NodeClassifier) *ProvisionHttpHandler

func (ProvisionHttpHandler) ServeHTTP

func (ctx ProvisionHttpHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)

type ResponseWriterWrapper

type ResponseWriterWrapper struct {
	// contains filtered or unexported fields
}

func (ResponseWriterWrapper) Header

func (w ResponseWriterWrapper) Header() http.Header

func (ResponseWriterWrapper) Write

func (w ResponseWriterWrapper) Write(data []byte) (int, error)

func (ResponseWriterWrapper) WriteHeader

func (w ResponseWriterWrapper) WriteHeader(statusCode int)

type RingLog

type RingLog struct {
	// contains filtered or unexported fields
}

func (*RingLog) Write

func (logBuffer *RingLog) Write(p []byte) (n int, err error)

type TaskResult

type TaskResult struct {
	Complete bool
	Success  bool
	Message  string
}

type WebhooksConfig

type WebhooksConfig struct {
	Secret                     string
	EnableStandardR10kListener bool
	R10kExecutable             string
	Listeners                  []ExecListener
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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