notify

package
v0.0.0-...-ca24b28 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VCAPRequestIDKey    = "vcap_request_id"
	RequestReceivedTime = "request_received_time"
)
View Source
const InvalidEmail = "<>InvalidEmail<>"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionInterface

type ConnectionInterface interface {
	services.ConnectionInterface
}

type DatabaseInterface

type DatabaseInterface interface {
	services.DatabaseInterface
}

type Dispatcher

type Dispatcher interface {
	Dispatch(dispatch services.Dispatch) ([]services.Response, error)
}

type EmailFormatter

type EmailFormatter struct{}

func (EmailFormatter) Format

func (EmailFormatter) Format(email string) string

type EmailHandler

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

func NewEmailHandler

func NewEmailHandler(notify notifyExecutor, errWriter errorWriter, strategy Dispatcher) EmailHandler

func (EmailHandler) ServeHTTP

func (h EmailHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context)

type EmailValidator

type EmailValidator struct{}

func (EmailValidator) Validate

func (validator EmailValidator) Validate(notify *NotifyParams) bool

type EveryoneHandler

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

func NewEveryoneHandler

func NewEveryoneHandler(notify notifyExecutor, errWriter errorWriter, strategy Dispatcher) EveryoneHandler

func (EveryoneHandler) ServeHTTP

func (h EveryoneHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context)

type GUIDValidator

type GUIDValidator struct{}

func (GUIDValidator) Validate

func (validator GUIDValidator) Validate(notify *NotifyParams) bool

type HTML

type HTML struct {
	BodyContent    string
	BodyAttributes string
	Head           string
	Doctype        string
}

type HTMLExtractor

type HTMLExtractor struct{}

func (HTMLExtractor) Extract

func (HTMLExtractor) Extract(rawHTML string) (string, string, string, string, error)

type Notify

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

func NewNotify

func NewNotify(finder clientAndKindFinder, registrar registrar) Notify

func (Notify) Execute

func (h Notify) Execute(connection ConnectionInterface, req *http.Request, context stack.Context,
	guid string, strategy Dispatcher, validator ValidatorInterface, vcapRequestID string) ([]byte, error)

type NotifyParams

type NotifyParams struct {
	ReplyTo string `json:"reply_to"`
	Subject string `json:"subject"`
	Text    string `json:"text"`
	RawHTML string `json:"html"`
	KindID  string `json:"kind_id"`
	To      string `json:"to"`
	Role    string `json:"role"`

	ParsedHTML        HTML
	KindDescription   string
	SourceDescription string
	Errors            []string
}

func NewNotifyParams

func NewNotifyParams(body io.ReadCloser) (NotifyParams, error)

func (*NotifyParams) FormatEmailAndExtractHTML

func (notify *NotifyParams) FormatEmailAndExtractHTML() error

type OrganizationHandler

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

func NewOrganizationHandler

func NewOrganizationHandler(notify notifyExecutor, errWriter errorWriter, strategy Dispatcher) OrganizationHandler

func (OrganizationHandler) ServeHTTP

func (h OrganizationHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context)

type Routes

type Routes struct {
	RequestCounter                  stack.Middleware
	RequestLogging                  stack.Middleware
	DatabaseAllocator               stack.Middleware
	NotificationsWriteAuthenticator stack.Middleware
	EmailsWriteAuthenticator        stack.Middleware

	Notify               notifyExecutor
	ErrorWriter          errorWriter
	UserStrategy         Dispatcher
	SpaceStrategy        Dispatcher
	OrganizationStrategy Dispatcher
	EveryoneStrategy     Dispatcher
	UAAScopeStrategy     Dispatcher
	EmailStrategy        Dispatcher
}

func (Routes) Register

func (r Routes) Register(m muxer)

type SpaceHandler

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

func NewSpaceHandler

func NewSpaceHandler(notify notifyExecutor, errWriter errorWriter, strategy Dispatcher) SpaceHandler

func (SpaceHandler) ServeHTTP

func (h SpaceHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context)

type UAAScopeHandler

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

func NewUAAScopeHandler

func NewUAAScopeHandler(notify notifyExecutor, errWriter errorWriter, strategy Dispatcher) UAAScopeHandler

func (UAAScopeHandler) ServeHTTP

func (h UAAScopeHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context)

type UserHandler

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

func NewUserHandler

func NewUserHandler(notify notifyExecutor, errWriter errorWriter, strategy Dispatcher) UserHandler

func (UserHandler) ServeHTTP

func (h UserHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, context stack.Context)

type ValidatorInterface

type ValidatorInterface interface {
	Validate(*NotifyParams) bool
}

Jump to

Keyboard shortcuts

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