Versions in this module Expand all Collapse all v0 v0.1.72 Sep 3, 2019 v0.1.12 Jun 25, 2020 v0.1.10 Mar 29, 2020 v0.1.9 Nov 25, 2019 v0.1.8 Sep 30, 2019 v0.1.7 Sep 1, 2019 v0.1.6 Jul 21, 2019 v0.1.5 Jun 9, 2019 v0.1.4 May 19, 2019 v0.1.3 May 4, 2019 v0.1.2 Apr 19, 2019 v0.0.9 Mar 4, 2019 Changes in this version + const APIAuthTypeBasicAuth + const APIAuthTypeKeyAuth + const APIAuthTypeNone + const APIMockFormatFile + const APIMockFormatJSON + const APIMockFormatText + const APIMockFormatXML + const APIStatusTypeError + const APIStatusTypeFailure + const APIStatusTypeNormal + const APIStatusTypeSuccess + const APIStatusTypeWarning + var SharedApiWatching = NewApiWatching() + func AllAuthTypes() []maps.Map + func AllStatusTypes() []maps.Map + func ContainsAuthType(authType string) bool + func FindAuthTypeName(authType string) string + type API struct + Address string + AuthType string + Author string + CacheOn bool + CachePolicy string + Company string + Description string + DoneThings []string + Filename string + Groups []string + IsAsynchronous bool + IsDeprecated bool + Limit *APILimit + MaxSize uint + Methods []string + MockFiles []string + MockOn bool + ModifiedAt int64 + Name string + On bool + Params []*APIParam + Path string + Response []byte + TestCaseFiles []string + TestScripts []string + Timeout float64 + TodoThings []string + Username string + Versions []string + func NewAPI() *API + func NewAPIFromFile(filename string) *API + func (this *API) AddMock(filename string) + func (this *API) AddParam(param *APIParam) + func (this *API) AddScript(script *APIScript) + func (this *API) AddTestCase(filename string) + func (this *API) AllowMethod(method string) bool + func (this *API) CachePolicyObject() *shared.CachePolicy + func (this *API) ChangeGroup(oldName string, newName string) + func (this *API) ChangeVersion(oldName string, newName string) + func (this *API) Delete() error + func (this *API) DeleteMock(mockFile string) + func (this *API) DeleteTestCase(filename string) + func (this *API) DeleteTestScript(filename string) error + func (this *API) FindTestCases() []*APITestCase + func (this *API) FindTestScript(filename string) *APIScript + func (this *API) FindTestScripts() []*APIScript + func (this *API) IsWatching() bool + func (this *API) Match(path string) (params map[string]string, matched bool) + func (this *API) MockDataFiles() []string + func (this *API) RandMock() *APIMock + func (this *API) RemoveGroup(name string) + func (this *API) RemoveVersion(name string) + func (this *API) Save() error + func (this *API) StartWatching() + func (this *API) StopWatching() + func (this *API) Validate() error + type APIAuthBasicAuth struct + Password string + Username string + func (this *APIAuthBasicAuth) KeyFromRequest(req *http.Request) string + func (this *APIAuthBasicAuth) MatchRequest(req *http.Request) bool + func (this *APIAuthBasicAuth) UniqueKey() string + type APIAuthInterface interface + KeyFromRequest func(req *http.Request) string + MatchRequest func(req *http.Request) bool + UniqueKey func() string + func NewAPIAuth(authType string, options map[string]interface{}) APIAuthInterface + func NewAPIAuthBasicAuth(options map[string]interface{}) APIAuthInterface + func NewAPIAuthKeyAuth(options map[string]interface{}) APIAuthInterface + func NewAPIAuthNoneAuth(options map[string]interface{}) APIAuthInterface + type APIAuthKeyAuth struct + FormField string + HeaderField string + Key string + func (this *APIAuthKeyAuth) KeyFromRequest(req *http.Request) string + func (this *APIAuthKeyAuth) MatchRequest(req *http.Request) bool + func (this *APIAuthKeyAuth) UniqueKey() string + type APIAuthNoneAuth struct + func (this *APIAuthNoneAuth) KeyFromRequest(req *http.Request) string + func (this *APIAuthNoneAuth) MatchRequest(req *http.Request) bool + func (this *APIAuthNoneAuth) UniqueKey() string + type APIConfig struct + ConsumerFiles []string + Files []string + Groups []string + MockOn bool + On bool + StatusList []*APIStatus + StatusScript string + StatusScriptOn bool + TestPlans []string + Versions []string + func NewAPIConfig() *APIConfig + func (this *APIConfig) AddAPI(api *API) + func (this *APIConfig) AddAPIGroup(name string) + func (this *APIConfig) AddAPIVersion(name string) + func (this *APIConfig) AddConsumer(consumerFile string) + func (this *APIConfig) AddStatus(status *APIStatus) + func (this *APIConfig) AddTestPlan(filename string) + func (this *APIConfig) ChangeAPIGroup(oldName string, newName string) + func (this *APIConfig) ChangeAPIVersion(oldName string, newName string) + func (this *APIConfig) DeleteAPI(api *API) + func (this *APIConfig) DeleteConsumer(consumerFile string) + func (this *APIConfig) DeleteTestPlan(filename string) error + func (this *APIConfig) ExistStatusCode(code string) bool + func (this *APIConfig) FindAPI(path string) *API + func (this *APIConfig) FindAPIStatus(code string) *APIStatus + func (this *APIConfig) FindActiveAPI(path string, method string) (api *API, params map[string]string) + func (this *APIConfig) FindAllAPIs() []*API + func (this *APIConfig) FindAllConsumers() []*APIConsumer + func (this *APIConfig) FindAllRunningConsumers() []*APIConsumer + func (this *APIConfig) FindConsumerForRequest(authType string, req *http.Request) (consumer *APIConsumer, authorized bool) + func (this *APIConfig) FindTestPlans() []*APITestPlan + func (this *APIConfig) MoveAPIStatus(fromIndex int, toIndex int) + func (this *APIConfig) MoveDownAPIGroup(name string) + func (this *APIConfig) MoveDownAPIStatus(code string) + func (this *APIConfig) MoveDownAPIVersion(name string) + func (this *APIConfig) MoveUpAPIGroup(name string) + func (this *APIConfig) MoveUpAPIStatus(code string) + func (this *APIConfig) MoveUpAPIVersion(name string) + func (this *APIConfig) RefreshStatusMap() + func (this *APIConfig) ReloadConsumers() + func (this *APIConfig) RemoveAPIGroup(name string) + func (this *APIConfig) RemoveAPIVersion(name string) + func (this *APIConfig) RemoveStatus(code string) + func (this *APIConfig) UpdateAPI(api *API) + func (this *APIConfig) Validate() error + type APIConsumer struct + API struct{ ... } + Auth struct{ ... } + Filename string + Name string + On bool + Policy shared.AccessPolicy + func NewAPIConsumer() *APIConsumer + func NewAPIConsumerFromFile(filename string) *APIConsumer + func (this *APIConsumer) AllowAPI(apiPath string) (passed bool) + func (this *APIConsumer) Delete() error + func (this *APIConsumer) Save() error + func (this *APIConsumer) Validate() error + type APIDataLimit struct + Duration string + Max uint + Total uint + func (this *APIDataLimit) Validate() error + type APILimit struct + Concurrent uint + DataLimits []*APIDataLimit + RequestLimits []*APIRequestLimit + func NewAPILimit() *APILimit + func (this *APILimit) Begin() + func (this *APILimit) Done() + func (this *APILimit) Validate() error + type APIMock struct + CreatedAt int64 + File string + Filename string + Format string + Headers []maps.Map + On bool + Text string + Username string + func NewAPIMock() *APIMock + func NewAPIMockFromFile(filename string) *APIMock + func (this *APIMock) Delete() error + func (this *APIMock) Save() error + type APIParam struct + Description string + Name string + Type string + type APIRequestLimit struct + Count uint + Duration string + func (this *APIRequestLimit) Validate() error + type APIScript struct + Code string + Filename string + func NewAPIScript() *APIScript + func (this *APIScript) Delete() error + func (this *APIScript) Save() error + type APIStatus struct + Code string + Description string + Groups []string + Type string + Versions []string + func NewAPIStatus() *APIStatus + func (this *APIStatus) TypeName() string + type APITestCase struct + AttachParams []maps.Map + CreatedAt int64 + Domain string + Filename string + Format string + Headers []maps.Map + Method string + Name string + Params []maps.Map + Query string + UpdatedAt int64 + Username string + func NewAPITestCase() *APITestCase + func NewAPITestCaseFromFile(filename string) *APITestCase + func (this *APITestCase) Delete() error + func (this *APITestCase) Save() error + type APITestPlan struct + APIs []string + Filename string + Hour int + Minute int + On bool + Reports []string + Second int + Weekdays []int + func NewAPITestPlan() *APITestPlan + func NewAPITestPlanFromFile(filename string) *APITestPlan + func (this *APITestPlan) AddReport(reportFilename string) + func (this *APITestPlan) Delete() error + func (this *APITestPlan) LastReport() *APITestPlanReport + func (this *APITestPlan) MatchTime(currentTime time.Time) bool + func (this *APITestPlan) Save() error + func (this *APITestPlan) WeekdayNames() []string + type APITestPlanReport struct + Filename string + FinishedAt int64 + Results []*APITestResult + StartedAt int64 + TotalAPIs int + TotalScripts int + func NewAPITestPlanReport() *APITestPlanReport + func NewAPITestPlanReportFromFile(filename string) *APITestPlanReport + func (this *APITestPlanReport) AddAPIResult(apiResult *APITestResult) + func (this *APITestPlanReport) CountFailedResults() int + func (this *APITestPlanReport) CountResults() int + func (this *APITestPlanReport) CountScripts() int + func (this *APITestPlanReport) InitFile() + func (this *APITestPlanReport) Save() error + func (this *APITestPlanReport) Summary() maps.Map + type APITestResult struct + API string + IsPassed bool + Scripts []*APITestScriptResult + func NewAPITestResult() *APITestResult + func (this *APITestResult) AddScriptResult(scriptResult *APITestScriptResult) + type APITestScriptResult struct + Code string + Failures []string + IsPassed bool + func NewAPITestScriptResult() *APITestScriptResult + type APIVersion struct + Code string + Name string + On bool + type ApiWatching struct + func NewApiWatching() *ApiWatching + func (this *ApiWatching) Add(path string) + func (this *ApiWatching) Contains(path string) bool + func (this *ApiWatching) Remove(path string)