Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultResponse = "default"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Body ¶
type Body struct {
ContentType domain.ContentType `json:"content_type"`
Payload string `json:"payload"`
}
type EndPoint ¶
type EndPoint struct {
Id string `json:"_id"`
Status bool `json:"status"`
Order int `json:"order"`
Timestamp int64 `json:"timestamp"`
Modified int64 `json:"modified"`
Name string `json:"name"`
Method domain.HttpMethod `json:"method"`
Path string `json:"path"`
Responses []Response `json:"responses"`
Safe bool `json:"safe"`
Owner string `json:"owner"`
}
func CleanEndPoint ¶
func FixEndPoint ¶
func FixEndPoints ¶
func ToEndPointFromFull ¶
func ToEndPointFromFull(endPoint *EndPointFull) (*EndPoint, []error)
func (EndPoint) DefaultResponse ¶
func (EndPoint) PersistenceId ¶
type EndPointFull ¶
type EndPointFull struct {
Id string `json:"_id"`
Status bool `json:"status"`
Order int `json:"order"`
Timestamp int64 `json:"timestamp"`
Modified int64 `json:"modified"`
Name string `json:"name"`
Method domain.HttpMethod `json:"method"`
Path string `json:"path"`
Responses []ResponseFull `json:"responses"`
Safe bool `json:"safe"`
Owner string `json:"owner"`
}
func FullFromEndPoint ¶
func FullFromEndPoint(endPoint *EndPoint) (*EndPointFull, []error)
type EndPointLite ¶
type EndPointLite struct {
Id string `json:"_id"`
Status bool `json:"status"`
Order int `json:"order"`
Timestamp int64 `json:"timestamp"`
Modified int64 `json:"modified"`
Name string `json:"name"`
Method domain.HttpMethod `json:"method"`
Path string `json:"path"`
Responses []string `json:"responses"`
Safe bool `json:"safe"`
Owner string `json:"owner"`
}
func LiteFromEndPoint ¶
func LiteFromEndPoint(endPoint *EndPoint) *EndPointLite
type Metrics ¶
type Metrics struct {
EndPoint string `json:"end_point"`
Timestamp int64 `json:"timestamp"`
Modified int64 `json:"modified"`
TotalUptime int64 `json:"total_uptime"`
LastStarted int64 `json:"last_started"`
TotalRequests int64 `json:"total_requests"`
CountResponses map[string]uint64 `json:"count_responses"`
MinLatency int64 `json:"min_latency"`
MaxLatency int64 `json:"max_latency"`
AvgLatency float64 `json:"avg_latency"`
}
func EmptyMetrics ¶
func (Metrics) PersistenceId ¶
type RepositoryEndPoint ¶
type RepositoryEndPoint interface {
FindAll(owner string) []EndPoint
FindMany(ids ...string) []EndPoint
Find(id string) (*EndPoint, bool)
FindByRequest(owner string, method domain.HttpMethod, path string) (*EndPoint, bool)
Insert(endPoint *EndPoint) *EndPoint
InsertMany(endPoint ...EndPoint) []EndPoint
Delete(endPoint *EndPoint) *EndPoint
}
type RepositoryMetrics ¶
type Response ¶
type Response struct {
Order int `json:"order"`
Status bool `json:"status"`
Code int `json:"code"`
Timestamp int64 `json:"timestamp"`
Condition string `json:"condition"`
Name string `json:"name"`
Arguments []Argument `json:"arguments"`
Body Body `json:"body"`
}
func FindResponse ¶
func FixResponses ¶
func ToResponse ¶
func ToResponse(response ResponseFull) *Response
func ToResponseWithOptions ¶
func ToResponseWithOptions(response ResponseFull, opts swr.MarshalOpts) (*Response, []error)
type ResponseFull ¶
type ResponseFull struct {
Order int `json:"order"`
Status bool `json:"status"`
Code int `json:"code"`
Timestamp int64 `json:"timestamp"`
Condition []swr.Step `json:"condition"`
Name string `json:"name"`
Arguments []Argument `json:"arguments"`
Body Body `json:"body"`
}
func FromResponse ¶
func FromResponse(response Response) *ResponseFull
func FromResponseWithOptions ¶
func FromResponseWithOptions(response Response, opts swr.UnmarshalOpts) (*ResponseFull, []error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.