Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssertionV1 ¶
type AssertionV1 struct {
StatusCode int `json:"statusCode"`
}
func (*AssertionV1) Scan ¶
func (assertion *AssertionV1) Scan(src interface{}) error
type Parameters ¶
type Parameters struct { Auth map[string]interface{} `json:"auth"` Header map[string]string `json:"header"` Query map[string]interface{} `json:"query"` Body map[string]interface{} `json:"body"` }
func (*Parameters) Scan ¶
func (parameters *Parameters) Scan(src interface{}) error
type Test ¶
type Test struct { rsmodels.DefaultValidateChecker Id string `json:"id"` Name string `json:"name"` WebServiceId string `json:"-"` WebService *WebService `json:"webService,omitempty" gorm:"PRELOAD:true"` Path rshttp.EndpointPath `json:"path"` Method rshttp.Method `json:"method"` ContentType rshttp.ContentType `json:"contentType"` Description string `json:"description" gorm:"Type:TEXT"` Parameters Parameters `json:"parameters" gorm:"Type:JSON"` Schedule TestSchedule `json:"schedule" gorm:"Column:schedule;Type:VARCHAR(5)"` Timeout rshttp.Timeout `json:"timeout"` Assertion AssertionV1 `json:"assertion" gorm:"Type:JSON"` Alerts WebHookAlerts `json:"alerts" gorm:"Column:alerts;Type:JSON"` CreatedAt time.Time `json:"createdAt"` ModifiedAt time.Time `json:"modifiedAt"` }
func NewTest ¶
func NewTest(webService *WebService, request TestRequest) (*Test, error)
func (Test) ToHttpRequest ¶
func (test Test) ToHttpRequest(webService *WebService) (*rshttp.Request, error)
func (*Test) UpdateFromRequest ¶
func (test *Test) UpdateFromRequest(request TestRequest) error
type TestListItem ¶
type TestListItem struct { Id string `json:"id"` WebServiceId string `json:"webServiceId" gorm:"foreignkey:WebServiceId"` WebService *WebService `json:"webService"` Path rshttp.EndpointPath `json:"path"` Method rshttp.Method `json:"method"` Description string `json:"description"` Created time.Time `json:"created"` LastModified time.Time `json:"lastModified"` }
func (TestListItem) MarshalJSON ¶
func (testListItem TestListItem) MarshalJSON() ([]byte, error)
func (TestListItem) TableName ¶
func (testListItem TestListItem) TableName() string
type TestListRequest ¶
type TestRequest ¶
type TestRequest struct { Id string `json:"-"` Name string `json:"name"` Path rshttp.EndpointPath `json:"path"` Method rshttp.Method `json:"method"` ContentType rshttp.ContentType `json:"contentType"` Description string `json:"description"` Parameters Parameters `json:"parameters"` Schedule TestSchedule `json:"schedule"` Assertion AssertionV1 `json:"assertion"` Alerts WebHookAlerts `json:"alerts"` Timeout int `json:"timeout"` }
func (TestRequest) Validate ¶
func (request TestRequest) Validate() error
type TestResult ¶
type TestResult struct { rsmodels.DefaultValidateChecker Id string `json:"id" gorm:"Size:36"` TestId string `json:"testId" gorm:"NOT NULL"` IsSuccess bool `json:"isSuccess"` StatusCode int `json:"statusCode"` Response string `json:"response" gorm:"Type:TEXT"` ResponseTime int64 `json:"responseTime"` TestedAt time.Time `json:"testedAt"` }
func (TestResult) ErrorMessage ¶
func (result TestResult) ErrorMessage() string
func (TestResult) TableName ¶
func (result TestResult) TableName() string
func (TestResult) Validate ¶
func (result TestResult) Validate() error
type TestResultListRequest ¶
type TestResultListRequest struct { Page int `json:"page"` NumItem int `json:"numItem"` IsSuccess IsSuccess `json:"isSuccess"` StartTestedAt time.Time `json:"startTestedAt"` EndTestedAt time.Time `json:"endTestedAt"` }
func (*TestResultListRequest) SetZeroToDefault ¶
func (request *TestResultListRequest) SetZeroToDefault()
type TestSchedule ¶
type TestSchedule string
const ( ScheduleOneMinute TestSchedule = "1m" ScheduleFiveMinute TestSchedule = "5m" ScheduleFifteenMinute TestSchedule = "15m" ScheduleThirtyMinute TestSchedule = "30m" ScheduleHourly TestSchedule = "1h" ScheduleDaily TestSchedule = "1d" )
func (TestSchedule) GetDuration ¶
func (schedule TestSchedule) GetDuration() time.Duration
func (TestSchedule) GetTicker ¶
func (schedule TestSchedule) GetTicker() *time.Ticker
func (*TestSchedule) UnmarshalJSON ¶
func (schedule *TestSchedule) UnmarshalJSON(data []byte) error
func (*TestSchedule) Validate ¶
func (schedule *TestSchedule) Validate() error
type WebHookAlerter ¶
func (WebHookAlerter) Alert ¶
func (alerter WebHookAlerter) Alert(msg string) error
type WebHookAlerts ¶
type WebHookAlerts []*WebHookAlerter
func (*WebHookAlerts) Scan ¶
func (alerts *WebHookAlerts) Scan(src interface{}) error
type WebService ¶
type WebService struct { rsmodels.DefaultValidateChecker Id string `json:"id" gorm:"private_key"` Host string `json:"host" gorm:"unique"` Schema string `json:"schema" gorm:"Size:20;Default:'http'"` Description string `json:"description" gorm:"Type:TEXT"` CreatedAt time.Time `json:"createdAt"` ModifiedAt time.Time `json:"modifiedAt"` }
func NewWebService ¶
func NewWebService(request WebServiceRequest) (*WebService, error)
func (*WebService) UpdateFromRequest ¶
func (webService *WebService) UpdateFromRequest(request WebServiceRequest) error
func (*WebService) Validate ¶
func (webService *WebService) Validate() error
type WebServiceListRequest ¶
type WebServiceRequest ¶
Click to show internal directories.
Click to hide internal directories.