fileProvider

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

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

func Factory

func Factory(ext string, lgr *logrus.Entry) (FileProvider, error)

type JSONProvider

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

JSONProvider

func NewJSONProvider

func NewJSONProvider(lgr *logrus.Entry) *JSONProvider

NewJSONProvider

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

Jump to

Keyboard shortcuts

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