email

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send_system_emails

func Send_system_emails(recipients []string, subject string, message string)

func Sendit

func Sendit(result *schedules.Jobstatus, templates_dir *Templates_Dir)

func Sendmail

func Sendmail(result *schedules.Jobstatus, emailaddr []string)

func SetLogger added in v0.1.53

func SetLogger(l *logrus.Logger)

func WriteYaml

func WriteYaml(result *schedules.Jobstatus) (string, error)

func Write_SLS

func Write_SLS(result *schedules.Jobstatus, templates_dir *Templates_Dir) (string, error)

Types

type Assigne_Channels_Job

type Assigne_Channels_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Group

type Group struct {
	gorm.Model
	Group_Name string             `json:"group_name"`
	T7User     string             `json:"t7user"`
	Ctx_ID     string             `json:"context_id"`
	Email      []Jobchecker_Email `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL"`
}

DB columns: ID, Group_Name, T7User, Email

type Host_Job_Info

type Host_Job_Info struct {
	Assigne_Channels_Job     Assigne_Channels_Job     `json:"Assigne_Channels_Job"`
	Pkg_Refresh_Job          Pkg_Refresh_Job          `json:"Pkg_Refresh_Job"`
	Update_Pkg_Job           Update_Pkg_Job           `json:"Update_Pkg_Job"`
	Reboot_Pre_MigrationJob  Reboot_Pre_MigrationJob  `json:"Reboot_Pre_MigrationJob"`
	SP_Migration_DryRun_Job  SP_Migration_DryRun_Job  `json:"SP_Migration_DryRun_Job"`
	SP_Migration_Job         SP_Migration_Job         `json:"SP_Migration_Job"`
	Reboot_Post_MigrationJob Reboot_Post_MigrationJob `json:"Reboot_Post_MigrationJob"`
}

type Job_Email_Body

type Job_Email_Body struct {
	Host         string
	Port         int
	T7user       string
	Template_dir string
	Recipients   []string
	Job_Response Job_Response
}

func (*Job_Email_Body) Send_Job_Response

func (s *Job_Email_Body) Send_Job_Response()

func (*Job_Email_Body) Send_Pkg_Updates_Email

func (s *Job_Email_Body) Send_Pkg_Updates_Email(db *gorm.DB)

func (*Job_Email_Body) Send_Pkg_Updates_Results

func (s *Job_Email_Body) Send_Pkg_Updates_Results(db *gorm.DB)

type Job_Response

type Job_Response struct {
	Server_name  string
	Base_channel string
	Server_id    int
	T7user       string
	Timestamp    time.Time
	//Message      string
	Job_ID     int
	Job_Status string
}

type Jobchecker_Email

type Jobchecker_Email struct {
	gorm.Model
	Email   string `json:"email"`
	GroupID uint   `json:"group_id"`
}

DB columns: ID, Email, GroupID

type Minion_Data

type Minion_Data struct {
	gorm.Model
	Minion_ID                int                `json:"Minion_ID"`
	Minion_Name              string             `json:"Minion_Name"`
	Minion_Status            string             `json:"Minion_Status"`
	Minion_Remarks           string             `json:"Minion_Remarks"`
	Clm_Stage                string             `json:"Clm_Stage"`
	Workflow_Step            string             `json:"Workflow_Step"`
	JobID                    int                `json:"JobID"`
	JobStatus                string             `json:"JobStatus"`
	Migration_Stage          string             `json:"Migration_Stage"`
	Migration_Stage_Status   string             `json:"Migration_Stage_Status"`
	Target_base_channel      string             `json:"Target_base_channel"`
	Target_Ident             string             `json:"Target_Ident"`
	Target_Optional_Channels []OptionalChannels `json:"Target_Optional_Channels" gorm:"foreignKey:Minion_DataRefer"`
	Minion_Groups            []Group            `json:"Minion_Groups" gorm:"many2many:Minion_Data_Groups;"`
}

DB columns: ID, Minion_ID, Minion_Name, Minion_Status, Workflow_Step, JobID, JobStatus, Migration_Stage, Migration_Stage_Status, Target_base_channel, Target_Ident, Target_Optional_Channels, Minion_Groups

func GetAll_Minions_From_DB

func GetAll_Minions_From_DB(db *gorm.DB) ([]Minion_Data, error)

type Minion_Data_SPMigration

type Minion_Data_SPMigration struct {
	Minion_ID              int           `json:"Minion_ID"`
	Minion_Name            string        `json:"Minion_Name"`
	Host_Job_Info          Host_Job_Info `json:"Host_Job_Info"`
	Migration_Stage        string        `json:"Migration_Stage"`
	Migration_Stage_Status string        `json:"Migration_Stage_Status"`
	Target_base_channel    string        `json:"Target_base_channel"`
	Target_Ident           string        `json:"Target_Ident"`
}

type OptionalChannels

type OptionalChannels struct {
	gorm.Model
	Channel_Label    string `json:"channel_label"`
	Minion_DataRefer uint   `json:"minion_data_refer"`
}

DB columns: ID, Channel_Label

type Pkg_Refresh_Job

type Pkg_Refresh_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Reboot_Post_MigrationJob

type Reboot_Post_MigrationJob struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Reboot_Pre_MigrationJob

type Reboot_Pre_MigrationJob struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Request

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

func NewRequest

func NewRequest(to []string, subject, body string) *Request

func (*Request) ParseTemplate

func (r *Request) ParseTemplate(templateFileName string, data interface{}) error

func (*Request) SendEmail

func (r *Request) SendEmail() (bool, error)

type SPMigration_Email_Body

type SPMigration_Email_Body struct {
	Host                      string
	Port                      int
	T7user                    string
	Template_dir              string
	SPmigration_Tracking_File string
	Recipients                []string
}

func (*SPMigration_Email_Body) Send_SPmigration_Email

func (s *SPMigration_Email_Body) Send_SPmigration_Email()

func (*SPMigration_Email_Body) Send_SPmigration_Results

func (s *SPMigration_Email_Body) Send_SPmigration_Results()

type SP_Migration_DryRun_Job

type SP_Migration_DryRun_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type SP_Migration_Job

type SP_Migration_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

type Target_Minions

type Target_Minions struct {
	Minion_List             []Minion_Data `json:"Minion_List"`
	Tracking_file_name      string        `json:"Tracking_file_name"`
	Suma_Group              string        `json:"Suma_Group"`
	Disk_Check_Disqualified []string      `json:"Disk_Check_Disqualified"`
	No_Upgrade_Exceptions   []string      `json:"No_Upgrade_Exceptions"`
	Offline_Minions         []string      `json:"Offline_Minions"`
	No_Targets_Minions      []Minion_Data `json:"No_Targets_Minions"`
	CSV_Reports             []string      `json:"CSV_Reports"`
}

type Templates_Dir

type Templates_Dir struct {
	Dir string
}

type Update_Pkg_Job

type Update_Pkg_Job struct {
	JobID     int    `json:"JobID"`
	JobStatus string `json:"JobStatus"`
}

Jump to

Keyboard shortcuts

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