{"modulePath":"github.com/subzeroDevelopment/ratchet","version":"v2.0.4+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package data\n\nPackage data holds custom types and functions for passing JSON between ratchet stages.\n\n## Functions\n\n```go\nfunc ObjectsFromJSON(d JSON) ([]map[string]interface{}, error)\n```\nObjectsFromJSON is a helper for parsing JSON into a slice of generic maps/objects. The use-case is when a stage is expecting to receive either a JSON object or an array of JSON objects, and want to deal with it in a generic fashion.\n\n```go\nfunc ParseJSON(d JSON, v interface{}) error\n```\nParseJSON is a simple wrapper for json.Unmarshal\n\n```go\nfunc ParseJSONSilent(d JSON, v interface{}) error\n```\nParseJSONSilent won't log output when unmarshaling fails. It can be used in cases where failure is expected.\n\n## Types\n\n```go\ntype JSON []byte\n```\nJSON is the data type that is passed along all data channels. Under the covers, JSON is simply a \\[]byte containing JSON data.\n\n```go\nfunc JSONFromHeaderAndRows(header []string, rows [][]interface{}) (JSON, error)\n```\nJSONFromHeaderAndRows takes the given header and rows of values, and turns it into a JSON array of objects.\n\n```go\nfunc NewJSON(v interface{}) (JSON, error)\n```\nNewJSON is a simple wrapper for json.Marshal.\n\n","path":"github.com/subzeroDevelopment/ratchet/data","name":"data","synopsis":"Package data holds custom types and functions for passing JSON between ratchet stages.","isRedistributable":true}
