notify

package
v0.0.0-...-b392570 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIEndPoint

type APIEndPoint struct {
	IEndPoint
	EndPoint
	// contains filtered or unexported fields
}

APIEndPoint is exported

func (*APIEndPoint) DoEvent

func (endpoint *APIEndPoint) DoEvent(event *Event, data interface{})

DoEvent is exported

type Container

type Container struct {
	ID     string
	Name   string
	Server string
	State  string
}

Container is exported

type EndPoint

type EndPoint struct {
	Name     string      `yaml:"name"`
	URL      string      `yaml:"url"`
	Enabled  bool        `yaml:"enabled"`
	Sender   string      `yaml:"sender"`
	Headers  http.Header `yaml:"headers"`
	Host     string      `yaml:"host"`
	Port     int         `yaml:"port"`
	User     string      `yaml:"user"`
	Password string      `yaml:"password"`
}

EndPoint is exported

type Engine

type Engine struct {
	IP    string
	Name  string
	State string
}

Engine is exported

type Event

type Event struct {
	ID          string
	Type        EventType
	Name        string
	Error       error
	ContactInfo string
	Endpoints   []IEndPoint
	// contains filtered or unexported fields
}

Event is exported

func NewEvent

func NewEvent(eventType EventType, description string, err error, contactInfo string, siteurl string, endpoints []IEndPoint) *Event

NewEvent is exported

type EventType

type EventType int

EventType is exported

const (
	//GroupEnginesWatchEvent is exported
	//cluster discovery watch nodes event
	GroupEnginesWatchEvent EventType = 1000
	//GroupMetaContainersEvent is exported
	//cluster meta containers migrated or recovered to warning event
	GroupMetaContainersEvent EventType = 1001
)

type GroupMeta

type GroupMeta struct {
	MetaID      string
	MetaName    string
	Location    string
	GroupID     string
	GroupName   string
	Instances   int
	Image       string
	ContactInfo string
	Engines     []*Engine
	Containers  []*Container
}

GroupMeta is exported

type IEndPoint

type IEndPoint interface {
	DoEvent(event *Event, data interface{})
}

IEndPoint is exported sender endPoint interface

func NewAPIEndPoint

func NewAPIEndPoint(endpoint EndPoint) IEndPoint

NewAPIEndPoint is exported

func NewSMTPEndpoint

func NewSMTPEndpoint(endpoint EndPoint) IEndPoint

NewSMTPEndpoint is exported

type INotifyEndPointFactory

type INotifyEndPointFactory interface {
	CreateAPIEndPoint(endpoint EndPoint) IEndPoint
	CreateSMTPEndPoint(endpoint EndPoint) IEndPoint
}

INotifyEndPointFactory is exported

type Notifications

type Notifications struct {
	EndPoints []EndPoint `yaml:"endpoints,omitempty"`
}

Notifications is exported

type NotifyEndPointFactory

type NotifyEndPointFactory struct {
	INotifyEndPointFactory
}

NotifyEndPointFactory is exported

func (*NotifyEndPointFactory) CreateAPIEndPoint

func (factory *NotifyEndPointFactory) CreateAPIEndPoint(endpoint EndPoint) IEndPoint

CreateAPIEndPoint is exported

func (*NotifyEndPointFactory) CreateSMTPEndPoint

func (factory *NotifyEndPointFactory) CreateSMTPEndPoint(endpoint EndPoint) IEndPoint

CreateSMTPEndPoint is exported

type NotifySender

type NotifySender struct {
	sync.RWMutex
	SiteURL string
	// contains filtered or unexported fields
}

NotifySender is exported

func NewNotifySender

func NewNotifySender(siteurl string, endPoints []EndPoint) *NotifySender

NewNotifySender is exported

func (*NotifySender) AddGroupEnginesWatchEvent

func (sender *NotifySender) AddGroupEnginesWatchEvent(description string, watchGroup *WatchGroup)

AddGroupEnginesWatchEvent is exported

func (*NotifySender) AddGroupMetaContainersEvent

func (sender *NotifySender) AddGroupMetaContainersEvent(description string, err error, groupMeta *GroupMeta)

AddGroupMetaContainersEvent is exported

type SMTPEndPoint

type SMTPEndPoint struct {
	IEndPoint
	EndPoint
	// contains filtered or unexported fields
}

SMTPEndPoint is exported

func (*SMTPEndPoint) DoEvent

func (endpoint *SMTPEndPoint) DoEvent(event *Event, data interface{})

DoEvent is exported

type WatchGroup

type WatchGroup struct {
	GroupID     string
	GroupName   string
	Location    string
	ContactInfo string
	Engines     []*Engine
}

WatchGroup is exported

type WatchGroups

type WatchGroups map[string]*WatchGroup

WatchGroups is exported

Jump to

Keyboard shortcuts

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