Documentation ¶
Index ¶
- func ComponentFactory(name string) *statuspagetypes.Component
- func ConfigureComponentMock(config *configuration.Config, components map[string]statuspagetypes.Component)
- func ConfigureGroupMock(config *configuration.Config, componentIDtoName map[string]string, ...)
- func GroupFactory(name string) *statuspagetypes.Group
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentFactory ¶
func ComponentFactory(name string) *statuspagetypes.Component
ComponentFactory helps make a unique component based on name alone. Creates an ID for the component to simplify testing, so that tests don't need to preface tests with information-gathering GETs to the mock. API functions themselves will strip out the ID before the component goes to the server.
func ConfigureComponentMock ¶
func ConfigureComponentMock(config *configuration.Config, components map[string]statuspagetypes.Component)
ConfigureComponentMock mimics the behavior of Statuspage's component API via the given backing map. Any components given in the initial map or created via the mock will have their page ID properly set. Created component IDs are incremented based on component map size and the number of deleted components. The caller is responsible for activating/deactivating/resetting httpmock.
func ConfigureGroupMock ¶ added in v0.2.2
func ConfigureGroupMock(config *configuration.Config, componentIDtoName map[string]string, groupIDtoGroup map[string]statuspagetypes.Group)
ConfigureGroupMock mimics the behavior of Statuspage's group API via the given backing map. Any groups given in the initial map or created via the mock will have their page ID properly set. Created component IDs are incremented based on component map size and the number of deleted components. The caller is responsible for activating/deactivating/resetting httpmock. NOTE: This mock mimics Statuspage's undocumented group payload behavior, see statuspagetypes.RequestGroup.
func GroupFactory ¶ added in v0.2.2
func GroupFactory(name string) *statuspagetypes.Group
GroupFactory helps make a unique group based on name alone. Creates an ID for the component to simplify testing, so that tests don't need to preface tests with information-gathering GETs to the mock. API functions themselves will strip out the ID before the component goes to the server.
Types ¶
This section is empty.