MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / Depth

Method Depth

options/options.go:80–88  ·  view source on GitHub ↗

Depth returns the depth of the Options in the hierarchy. The main Options has a depth of 0, its child has a depth of 1, and so on.

()

Source from the content-addressed store, hash-verified

78// Depth returns the depth of the Options in the hierarchy.
79// The main Options has a depth of 0, its child has a depth of 1, and so on.
80func (o *Options) Depth() int {
81 depth := 0
82
83 for p := o.main; p != nil && p != o; p = p.child {
84 depth++
85 }
86
87 return depth
88}
89
90// Get retrieves a value of the specified type from the options.
91// If the key does not exist, it returns the provided default value.

Callers 1

TestDepthMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestDepthMethod · 0.64