Documentation ¶
Index ¶
- func IssueCommentEventFromJSON(data io.Reader) (*github.IssueCommentEvent, error)
- func NewBool(b bool) *bool
- func NewInt(n int) *int
- func NewInt32(n int32) *int32
- func NewInt64(n int64) *int64
- func NewString(s string) *string
- func PingEventFromJSON(data io.Reader) (*github.PingEvent, error)
- func PullRequestEventFromJSON(data io.Reader) (*github.PullRequestEvent, error)
- func ValidateSignature(receivedHash []string, bodyBuffer []byte, secretKey string) error
- type Builds
- type CWS
- type CloudAuth
- type Deployment
- type MatterwickConfig
- type MockedBuilds
- type Server
- func (s *Server) CheckLimitRateAndAbortRequest() bool
- func (s *Server) CheckLimitRateAndSleep()
- func (s *Server) GetPullRequestFromGithub(pullRequest *github.PullRequest) (*model.PullRequest, error)
- func (s *Server) GetUpdateChecks(owner, repoName string, prNumber int) (*model.PullRequest, error)
- func (s *Server) Start()
- func (s *Server) Stop()
- type WebhookRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IssueCommentEventFromJSON ¶
func IssueCommentEventFromJSON(data io.Reader) (*github.IssueCommentEvent, error)
IssueCommentEventFromJSON parses json to a github.IssueCommentEvent
func PingEventFromJSON ¶
PingEventFromJSON parses json to a github.PingEvent
func PullRequestEventFromJSON ¶
func PullRequestEventFromJSON(data io.Reader) (*github.PullRequestEvent, error)
PullRequestEventFromJSON parses json to a github.PullRequestEvent
Types ¶
type Builds ¶
type Builds struct{}
Builds implements buildsInterface for working with external CI/CD systems.
type CWS ¶
type CWS struct { Database string CWSSiteURL string CWSSMTPUsername string CWSSMTPPassword string CWSSMTPServer string CWSSMTPPort string CWSSMTPServerTimeout string CWSSMTPConnectionSecurity string CWSEmailReplyToName string CWSEmailReplyToAddress string CWSEmailBCCAddress string CWSCloudURL string CWSStripeKey string CWSCloudDNSDomain string CWSCloudGroupID string CWSBlapiURL string CWSBlapiToken string CWSLicenseGeneratorURL string CWSLicenseGeneratorKey string CWSDisableRenewalChecks string CWSSplitKey string CWSSplitServerID string CloudDefaultProductID string CloudDefaultTrialProductID string DockerHubCredentials string CWSPublicPort string CWSPrivatePort string }
CWS contains all configuration for the Customer Web Server
type Deployment ¶
type Deployment struct { Namespace string PR int ImageTag string DeployFilePath string Environment CWS }
Deployment contains information needed to create a deployment in Kubernetes
type MatterwickConfig ¶
type MatterwickConfig struct { ListenAddress string MatterWickURL string GithubAccessToken string GitHubTokenReserve int GithubUsername string GitHubWebhookSecret string Org string Username string SetupSpinWick string SetupSpinWickHA string SetupSpinWickWithCWS string SpinWickHALicense string ProvisionerServer string AWSAPIKey string DNSNameTestServer string CloudGroupID string SetupSpinmintMessage string SetupSpinmintFailedMessage string DestroyedSpinmintMessage string DockerRegistryURL string DockerUsername string DockerPassword string MattermostWebhookURL string KubeClusterName string KubeClusterRegion string LogSettings struct { EnableDebug bool ConsoleJSON bool } CWSPublicAPIAddress string CWSInternalAPIAddress string CWSAPIKey string CWSUserPassword string CWSSpinwickGroupID string CWS CWS CloudAuth CloudAuth }
MatterwickConfig defines all config for to run the server
func GetConfig ¶
func GetConfig(fileName string) (*MatterwickConfig, error)
GetConfig gets the config
type MockedBuilds ¶
type MockedBuilds struct {
Version string
}
MockedBuilds implements buildsInterface but returns hardcoded information. This is used for local development and/or testing.
type Server ¶
type Server struct { Config *MatterwickConfig Router *mux.Router Builds buildsInterface StartTime time.Time Logger logrus.FieldLogger CloudClient *cloudModel.Client // contains filtered or unexported fields }
Server is the MatterWick server.
func New ¶
func New(config *MatterwickConfig) *Server
New returns a new server with the desired configuration
func (*Server) CheckLimitRateAndAbortRequest ¶
CheckLimitRateAndAbortRequest checks the api rate and abort the request if needed
func (*Server) CheckLimitRateAndSleep ¶
func (s *Server) CheckLimitRateAndSleep()
CheckLimitRateAndSleep checks the api rate and sleep if needed
func (*Server) GetPullRequestFromGithub ¶
func (s *Server) GetPullRequestFromGithub(pullRequest *github.PullRequest) (*model.PullRequest, error)
GetPullRequestFromGithub get updated pr info
func (*Server) GetUpdateChecks ¶
GetUpdateChecks retrieve updated status checks from GH
type WebhookRequest ¶
WebhookRequest defines the message to send to MM