Documentation ¶
Index ¶
- func DefinePropertyPaths(collection *Collection)
- func SchemaResolver(path string) providers.SchemaResolver
- func ServiceManifest(collection *Collection) specs.ServiceList
- func ServicesResolver(path string) providers.ServicesResolver
- func SpecsMethod(method *Method) *specs.Method
- func SpecsService(service *Service) *specs.Service
- type Collection
- type Exception
- type Method
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefinePropertyPaths ¶
func DefinePropertyPaths(collection *Collection)
DefinePropertyPaths defines all property paths inside the given collection
func SchemaResolver ¶
func SchemaResolver(path string) providers.SchemaResolver
SchemaResolver returns a new schema resolver for the given mock collection
func ServiceManifest ¶
func ServiceManifest(collection *Collection) specs.ServiceList
ServiceManifest formats the given mock collection to a specs service(s) manifest
func ServicesResolver ¶
func ServicesResolver(path string) providers.ServicesResolver
ServicesResolver returns a new service(s) resolver for the given mock collection
func SpecsMethod ¶
SpecsMethod formats the given mock method to a specs method
func SpecsService ¶
SpecsService formats the given mock service to a specs service
Types ¶
type Collection ¶
type Collection struct { Exception Exception `yaml:"exception"` Services map[string]*Service `yaml:"services"` Properties map[string]*specs.Property `yaml:"properties"` }
Collection represents a mock YAML file
func CollectionResolver ¶
func CollectionResolver(path string) (*Collection, error)
CollectionResolver returns the full mock collection
func NewCollection ¶
func NewCollection(descriptor Collection) *Collection
NewCollection constructs a new schema collection from the given descriptors
func UnmarshalFile ¶
func UnmarshalFile(reader io.Reader) (*Collection, error)
UnmarshalFile attempts to parse the given Mock YAML file to intermediate resources.
func (*Collection) GetService ¶
func (collection *Collection) GetService(name string) *Service
GetService attempts to find the given service
func (*Collection) GetServices ¶
func (collection *Collection) GetServices() []*Service
GetServices returns all available services inside the given collection
type Exception ¶
type Exception struct { File string `yaml:"file"` Line int `yaml:"line"` Message string `yaml:"message"` }
Exception represents a exception thrown during runtime
type Method ¶
type Method struct { Name string Comment string `yaml:"comment"` Input string `yaml:"input"` Output string `yaml:"output"` Options specs.Options `yaml:"options"` }
Method represents a mock YAML service method
type Service ¶
type Service struct { Name string Package string `yaml:"package"` Comment string `yaml:"comment"` Host string `yaml:"host"` Transport string `yaml:"transport"` Codec string `yaml:"codec"` Methods map[string]*Method `yaml:"methods"` Options specs.Options `yaml:"options"` }
Service represents a mocking service
func NewService ¶
NewService constructs a new service with the given descriptor
func (*Service) GetMethods ¶
GetMethods attempts to return the given service methods