responsetemplatemanager

package
v3.5.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 4 Imported by: 4

Documentation

Overview

Package responsetemplatemanager provides basic functionality to handle API response data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseTemplateManager

type ResponseTemplateManager struct {
	// contains filtered or unexported fields
}

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) *rt.ResponseTemplate

GetTemplate method to get a ResponseTemplate from templates container

func (*ResponseTemplateManager) GetTemplates

func (rtm *ResponseTemplateManager) GetTemplates() map[string]rt.ResponseTemplate

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL