The go camlistore.org.pkg.importer object is a package library used for importing data into camlistore, a content addressable storage system. This object provides a function that reads metadata and raw data from an input stream and writes it to an instance of camlistore.
Example code using go camlistore.org.pkg.importer:
func main() { // create a new importer object imp := importer.New(os.Stdout, nil)
// set the metadata for the file meta := map[string]string{ "title": "My Vacation", "author": "John Doe", }
// create a new part part := imp.StartPart(meta)
// write the data to the part _, err := io.WriteString(part, "This is the data for my vacation photos.") if err != nil { panic(err) }
// close the part err = part.Close() if err != nil { panic(err) } }
This code imports metadata for a file by creating a new part and using the StartPart method of the importer object. The metadata is defined in a map and written to the part along with the raw data.
Overall, the go camlistore.org.pkg.importer object is a package library used for importing data into camlistore, and provides functions for importing both metadata and raw data.
Golang Object - 30 examples found. These are the top rated real world Golang examples of camlistore/org/pkg/importer.Object extracted from open source projects. You can rate examples to help us improve the quality of examples.