HasExtension returns true if the server supports a given API extension. Deprecated: Use CheckExtension instead.
(extension string)
| 61 | // HasExtension returns true if the server supports a given API extension. |
| 62 | // Deprecated: Use CheckExtension instead. |
| 63 | func (r *ProtocolIncus) HasExtension(extension string) bool { |
| 64 | // If no cached API information, just assume we're good |
| 65 | // This is needed for those rare cases where we must avoid a GetServer call |
| 66 | if r.server == nil { |
| 67 | return true |
| 68 | } |
| 69 | |
| 70 | return slices.Contains(r.server.APIExtensions, extension) |
| 71 | } |
| 72 | |
| 73 | // CheckExtension checks if the server has the specified extension. |
| 74 | func (r *ProtocolIncus) CheckExtension(extensionName string) error { |
no test coverage detected