Documentation ¶
Overview ¶
Package responsetemplatemanager provides basic functionality to handle API response data
Index ¶
- type ResponseTemplateManager
- func (rtm *ResponseTemplateManager) AddTemplate(id string, plain string) *ResponseTemplateManager
- func (rtm *ResponseTemplateManager) GenerateTemplate(code string, description string) string
- func (rtm *ResponseTemplateManager) GetTemplate(id string) string
- func (rtm *ResponseTemplateManager) GetTemplates() map[string]string
- func (rtm *ResponseTemplateManager) HasTemplate(id string) bool
- func (rtm *ResponseTemplateManager) IsTemplateMatchHash(tpl2 map[string]interface{}, id string) bool
- func (rtm *ResponseTemplateManager) IsTemplateMatchPlain(plain string, id string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseTemplateManager ¶
ResponseTemplateManager is a struct used to cover basic functionality to work with API response templates.
func GetInstance ¶
func GetInstance() *ResponseTemplateManager
GetInstance method to return the responsetemplatemanager singleton instance
func (*ResponseTemplateManager) AddTemplate ¶
func (rtm *ResponseTemplateManager) AddTemplate(id string, plain string) *ResponseTemplateManager
AddTemplate method to add a template to the templates container
func (*ResponseTemplateManager) GenerateTemplate ¶
func (rtm *ResponseTemplateManager) GenerateTemplate(code string, description string) string
GenerateTemplate method to generate API a response template string for given code and description
func (*ResponseTemplateManager) GetTemplate ¶
func (rtm *ResponseTemplateManager) GetTemplate(id string) string
GetTemplate method to get a ResponseTemplate from templates container
func (*ResponseTemplateManager) GetTemplates ¶
func (rtm *ResponseTemplateManager) GetTemplates() map[string]string
GetTemplates method to return a map covering all available response templates
func (*ResponseTemplateManager) HasTemplate ¶
func (rtm *ResponseTemplateManager) HasTemplate(id string) bool
HasTemplate method to check if given template id exists in template container
func (*ResponseTemplateManager) IsTemplateMatchHash ¶
func (rtm *ResponseTemplateManager) IsTemplateMatchHash(tpl2 map[string]interface{}, id string) bool
IsTemplateMatchHash method to check if given API response hash matches a given template by code and description
func (*ResponseTemplateManager) IsTemplateMatchPlain ¶
func (rtm *ResponseTemplateManager) IsTemplateMatchPlain(plain string, id string) bool
IsTemplateMatchPlain method to check if given API plain response matches a given template by code and description