model

package
v0.0.0-...-4a54890 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResposeCode   = errors.New("Response code does not Match expected value")
	ErrResposeBody   = errors.New("Response body does not match expected value")
	ErrTimeout       = errors.New("Request Time out Error")
	ErrCreateRequest = errors.New("Invalid Request Config. Not able to create request")
	ErrDoRequest     = errors.New("Request failed")
)

Functions

func CreateKeyValuePairs

func CreateKeyValuePairs(m map[string]string) string

Types

type Account

type Account struct {
	ID        string       `json:"id"`
	Name      string       `json:"name"`
	ServedBy  string       `json:"servedBy"`
	Quote     Quote        `json:"quote"`
	ImageData AccountImage `json:"imageData"`
}

Account defines ...

func (*Account) ToString

func (a *Account) ToString() string

ToString is a somewhat generic ToString method.

type AccountImage

type AccountImage struct {
	URL      string `json:"url"`
	ServedBy string `json:"servedBy"`
}

AccountImage

func (*AccountImage) ToString

func (a *AccountImage) ToString() string

ToString is a somewhat generic ToString method.

type EmailAddress

type EmailAddress string

EmailAddress is just a little experiment with go types.

func (EmailAddress) IsValid

func (e EmailAddress) IsValid() bool

IsValid is just a sample method.

type ErrorInfo

type ErrorInfo struct {
	Id           int
	Url          string
	RequestType  string
	ResponseCode int
	ResponseBody string
	Reason       error
	OtherInfo    string
}

type ErrorNotification

type ErrorNotification struct {
	Url         string
	RequestType string
	Error       string
	OtherInfo   string
}

type MessageType

type MessageType string
var (
	// ResponseTimeMessage = "Warning notification From Endpoint Monitor" +
	// 	"\n\nAPI response is returning slower than expected." +
	// 	"\n\nDetails below:" +
	// 	"\nUrl: %v \nRequestType: %v \nCurrent Average Response Time: %v ms\nExpected Response Time: %v ms\n"
	ResponseTimeMessage MessageType = "Warning notification From Endpoint Monitor" +
		"\n\nAPI response is returning slower than expected." +
		"\n\nDetails below:" +
		"\nUrl: %v \nRequestType: %v \nCurrent Average Response Time: %v ms\nExpected Response Time: %v ms\n"
	ResponseCodeMessage MessageType = "ResponseCode"
	ResponseBodyMessage MessageType = "ResponseBody"
	CertMismatchMessage MessageType = "CertMismatch"
	CertExpiringMessage MessageType = "CertExpiring"
	CertExpiredMessage  MessageType = "CertExpired"
	ErrorMessage        MessageType = "Error notification From Endpoint Monitor" +
		"\n\nCannot communicate with " +
		"\n\nPlease find the Details below" +
		"\n\nUrl: %v \nRequestType: %v \nError Message: %v \nOther Info:%v\n"
		// "\n\nUrl: %v \nRequestType: %v \nError Message: %v \nResponse Body: %v\nOther Info:%v\n"+
		// "\n\nThanks", errorNotification.Url, errorNotification.RequestType, errorNotification.Error, errorNotification.ResponseBody, model.ErrorNotification.OtherInfo)
	InformationMessage MessageType = "Information"
)

type MetricDb

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

type Notification

type Notification struct {
	Url                  string
	MessageType          MessageType
	Endpoints            []string
	RequestType          string
	Environment          string
	Priority             string
	ExpectedResponseCode int64
	ResponseCode         int64
	ExpectedResponseTime int64
	ExpectedResponseBody string
	ResponseTime         int64
	ResponseBody         string
	Subject              string
	Description          string
	Message              string
	Error                string
	OtherInfo            string
	Tags                 []string
	Details              map[string]string
	Note                 string
	// contains filtered or unexported fields
}

func CreateNotification

func CreateNotification(n Notification) Notification

type Quote

type Quote struct {
	Text     string `json:"quote"`
	ServedBy string `json:"ipAddress"`
	Language string `json:"language"`
}

Quote defines a Quote as provided by the quotes-service

type RequestInfo

type RequestInfo struct {
	Id                   int
	Url                  string
	RequestType          string
	ResponseCode         int64
	ExpectedResponseCode int64
	ResponseTime         int64
	ExpectedResponseTime int64
	ResponseBody         string
	ExpectedResponseBody string
}

type ResponseBodyNotification

type ResponseBodyNotification struct {
	Url                  string
	RequestType          string
	Environment          string
	Priority             string
	ExpectedResponseCode int64
	ResponseCode         int64
	ExpectedResponseBody string
	ResponseBody         string
}

type ResponseCodeNotification

type ResponseCodeNotification struct {
	Url                  string
	RequestType          string
	ExpectedResponseCode int64
	ResponseCode         int64
}

type ResponseTimeNotification

type ResponseTimeNotification struct {
	Url                  string
	RequestType          string
	ExpectedResponsetime int64
	MeanResponseTime     int64
}

Jump to

Keyboard shortcuts

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