MCPcopy
hub / github.com/perkeep/perkeep / initPrefix

Method initPrefix

pkg/client/client.go:975–987  ·  view source on GitHub ↗

initPrefix uses the user provided server URL to define the URL prefix to the blobserver root. If the server URL has a path component then it is directly used, otherwise the blobRoot from the discovery is used as the path.

()

Source from the content-addressed store, hash-verified

973// component then it is directly used, otherwise the blobRoot
974// from the discovery is used as the path.
975func (c *Client) initPrefix() error {
976 c.isSharePrefix = false
977 root := c.discoRoot()
978 u, err := url.Parse(root)
979 if err != nil {
980 return err
981 }
982 if len(u.Path) > 1 {
983 c.prefixv = strings.TrimRight(root, "/")
984 return nil
985 }
986 return c.condDiscovery()
987}
988
989func (c *Client) condDiscovery() error {
990 if c.sto != nil {

Callers

nothing calls this directly

Calls 3

discoRootMethod · 0.95
condDiscoveryMethod · 0.95
ParseMethod · 0.80

Tested by

no test coverage detected