Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateBaseFileStruct ¶
func ValidateBaseFileStruct(scenario scenarios.BaseGigaMockScenario) error
ValidateBaseFileStruct is a base file fields validator This method is validate base fields path, method and type for a particular file type and format
Types ¶
type FileProvider ¶
type FileProvider interface { Validate(scenario scenarios.BaseGigaMockScenario) error Unmarshal(filePath string) (*scenarios.BaseGigaMockScenario, error) }
FileProvider is an interface which will be extended to accomplish case with different types of file providers like a yml ot json that provides a possibility to use diff file parsing
type JSONProvider ¶
type JSONProvider struct {
// contains filtered or unexported fields
}
JSONProvider
func (*JSONProvider) Unmarshal ¶
func (j *JSONProvider) Unmarshal(filePath string) (*scenarios.BaseGigaMockScenario, error)
Unmarshal
func (JSONProvider) Validate ¶
func (j JSONProvider) Validate(scenario scenarios.BaseGigaMockScenario) error
Validate
type YAMLProvider ¶
type YAMLProvider struct {
// contains filtered or unexported fields
}
YAMLProvider
func NewYAMLProvider ¶
func NewYAMLProvider(lgr *logrus.Entry) *YAMLProvider
func (YAMLProvider) Unmarshal ¶
func (y YAMLProvider) Unmarshal(filePath string) (*scenarios.BaseGigaMockScenario, error)
Parse
func (YAMLProvider) Validate ¶
func (y YAMLProvider) Validate(scenario scenarios.BaseGigaMockScenario) error
Click to show internal directories.
Click to hide internal directories.