provider

package
v0.0.0-...-f74d7f1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Subject is a string:
	// Successful or Errored: <service name>.
	Subject = "%s: %s"
	// From defines the address of the sender.
	From = "Caicloud CI <%s>"
	// ContentType defines the contentType of the email.
	ContentType = "text/html"
	// WebServiceURL defines the url of cyclone.
	// TODO: Move the definitions of cyclone Port in main to utils package and remove this const var.
	WebServiceURL = "http://localhost:7099"
	// SUCCESSTEMPLATE defines the env var, which points to the template.
	SUCCESSTEMPLATE = "SUCCESSTEMPLATE"
	// ERRORTEMPLATE defines the env var, which points to the template.
	ERRORTEMPLATE = "ERRORTEMPLATE"
	// UsernameVarName defines the username in the template.
	UsernameVarName = "$$USERNAME"
	// ServiceNameVarName defines the service name in the template.
	ServiceNameVarName = "$$SERVICENAME"
	// RepoURLVarName defines the URL of the repo in the template.
	RepoURLVarName = "$$REPOURL"
	// CommitIDVarName defines the commitID in the template.
	CommitIDVarName = "$$COMMITID"
	// LogVarName defines the log name in the template.
	LogVarName = "$$LOG"
	// DeployStatusVarName defines the deploy status in the template.
	DeployStatusVarName = "$$DEPLOYSTATUS"
	// DeployPlanStatusVarName defines the deploy plan status in the template.
	DeployPlanStatusVarName = "$$DEPLOYPLANSTATUS"
)

Variables

View Source
var (
	// SuccessFilename is the file name for SUCCESSTEMPLATE.
	SuccessFilename string
	// ErrorFilename is the file name for ERRORTEMPLATE.
	ErrorFilename string
	// SuccessfulBody defines the body of the email when the version is successful.
	SuccessfulBody string
	// ErroredBody defines the body of the email when the version is failed.
	ErroredBody string
)

Functions

This section is empty.

Types

type EmailNotifier

type EmailNotifier struct {
	SMTPServer   string
	SMTPPort     int
	SMTPUsername string
	SMTPPassWord string
}

EmailNotifier is the email Notifier, which uses the Paging Client to send emails to users.

func NewEmailNotifier

func NewEmailNotifier(SMTPServer string, SMTPPort int, SMTPUsername, SMTPPassword string) (*EmailNotifier, error)

NewEmailNotifier returns a new EmailNotifier.

func (EmailNotifier) Notify

func (e EmailNotifier) Notify(service *api.Service, version *api.Version, versionLog string) error

Notify sends the email to the email address defined in the api.Service.

Jump to

Keyboard shortcuts

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