Documentation ¶
Overview ¶
Package library is a package that keeps track of resources available to a user. A library consists of resources that a peer can offer, and resources that a peer has received.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignRandomIDs ¶
AssignRandomIDs takes a slice of resources, and assigns each a random ID.
Types ¶
type Resource ¶
type Resource struct { Name string `json:"name"` //name of the resource (cats.jpg) Description string `json:"description"` //short description of the resource Location string `json:"location"` //TODO make this a file type MimeType string `json:"mimetype"` // contains filtered or unexported fields }
Resource holds information about files a peer can share.
func CreateResourceFromJSON ¶
CreateResourceFromJSON take a string representation of json data, and creates a Resource from it.
func LoadResourcesFrom ¶
LoadResourcesFrom takes a path to a file that contains JSON descriptions of resources. This function will create a slice of pointers to resources.
Click to show internal directories.
Click to hide internal directories.