MCPcopy Create free account
hub / github.com/brimdata/super / FromSpec

Method FromSpec

dbid/head.go:29–43  ·  view source on GitHub ↗
(meta string)

Source from the content-addressed store, hash-verified

27var ErrNoPool = errors.New("no pool")
28
29func (c *Commitish) FromSpec(meta string) (string, error) {
30 if c.Pool == "" {
31 return "", ErrNoPool
32 }
33 var s string
34 if _, err := ParseID(c.Branch); err == nil {
35 s = fmt.Sprintf("from '%s'@%s", c.Pool, c.Branch)
36 } else {
37 s = fmt.Sprintf("from '%s'@'%s'", c.Pool, c.Branch)
38 }
39 if meta != "" {
40 s += ":" + meta
41 }
42 return s, nil
43}
44
45func (c *Commitish) String() string {
46 return fmt.Sprintf("%s@%s", c.Pool, c.Branch)

Callers 2

VectorFilterCompileFunction · 0.80
RunMethod · 0.80

Calls 1

ParseIDFunction · 0.85

Tested by

no test coverage detected