Documentation
¶
Index ¶
- type Cache
- func (c *Cache) AddPlaceholder(url string) (newPlaceholder *placeholder, hotWriter io.WriteCloser)
- func (c *Cache) FetchIpfs(ipfsPath string) (r io.ReadCloser, err error)
- func (c *Cache) HardResolve(resourceID string) (ipfsPath string, hotReader io.Reader, err error)
- func (c *Cache) Load(filename string) error
- func (c *Cache) QuickLookup(url string) (ipfsPath string, exists bool)
- func (c *Cache) SoftResolve(resourceID string) (ipfsPath string, err error)
- func (c *Cache) UrlCacheLookup(url string) (resourceID string, err error)
- func (c *Cache) Write(filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Placeholders map[string]*placeholder // contains filtered or unexported fields }
func NewCache ¶
Function which will provide a new cache struct An cache must be provided a file that it can read/write it's data to so that the cache is preserved between launches
func (*Cache) AddPlaceholder ¶
func (c *Cache) AddPlaceholder(url string) (newPlaceholder *placeholder, hotWriter io.WriteCloser)
func (*Cache) HardResolve ¶
HardResolve will take the url and check it against the Placeholders it ensures that you will always get a reader, blocking if necessary
func (*Cache) Load ¶
Method which will load the provided cache data file. Will overwrite the internal state of the object. Should pretty much only be used when the object is created but it is left public in case a client needs to load old data or something
func (*Cache) SoftResolve ¶
func (*Cache) UrlCacheLookup ¶
Click to show internal directories.
Click to hide internal directories.