Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver represents a resolver that can resolve data in a CAS based on a CID and WebCAS URL.
func (*Resolver) Resolve ¶
func (h *Resolver) Resolve(webCASURL *url.URL, cidWithPossibleHint string, data []byte) ([]byte, error)
Resolve does the following:
- If data is provided (not nil), then it will be stored via the local CAS. That data passed in will then simply be returned back to the caller.
- If data is not provided (is nil), then the local CAS will be checked to see if it has data at the cid provided. If it does, then it is returned. If it doesn't, and a webCASURL is provided, then the data will be retrieved by querying the webCASURL. This data will then get stored in the local CAS. Finally, the data is returned to the caller.
In both cases above, the CID produced by the local CAS will be checked against the cid passed in to ensure they are the same.
Click to show internal directories.
Click to hide internal directories.