MCPcopy
hub / github.com/cayleygraph/cayley / IntKey

Method IntKey

graph/quadstore.go:142–152  ·  view source on GitHub ↗
(key string, def int)

Source from the content-addressed store, hash-verified

140)
141
142func (d Options) IntKey(key string, def int) (int, error) {
143 if val, ok := d[key]; ok {
144 if reflect.TypeOf(val).ConvertibleTo(typeInt) {
145 i := reflect.ValueOf(val).Convert(typeInt).Int()
146 return int(i), nil
147 }
148
149 return def, fmt.Errorf("Invalid %s parameter type from config: %T", key, val)
150 }
151 return def, nil
152}
153
154func (d Options) StringKey(key string, def string) (string, error) {
155 if val, ok := d[key]; ok {

Callers 2

quadIndexesMethod · 0.80
connectFunction · 0.80

Calls 2

ValueOfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected