Documentation ¶
Overview ¶
Package mdocspec parses yaml OC requirements from functional test READMEs.
Index ¶
Constants ¶
const ( // OCSpecHeading is the MarkDown heading that MUST precede the yaml // section containing the OC path and RPC listing. OCSpecHeading = "OpenConfig Path and RPC Coverage" )
Variables ¶
var ErrNotFound = fmt.Errorf(`did not detect valid yaml block under a heading titled %q, please see https://github.com/openconfig/featureprofiles/blob/main/doc/test-requirements-template.md#openconfig-path-and-rpc-coverage for example, and https://github.com/openconfig/featureprofiles/tree/main/tools/fpcli/README.md for a tool for viewing the full names of all extant OC RPCs`, OCSpecHeading)
ErrNotFound indicates the OpenConfig Path and RPC Coverage YAML block was not found or was invalid.
var MDOCSpecs = &mdOCSpecs{}
MDOCSpecs is an extension that only renders the first yaml block from a functional test README that comes after the pre-established OC Spec heading `OCSpecHeading`.
Functions ¶
func Parse ¶
Parse extracts sorted OpenConfig Path and RPC Coverage from a featureprofiles README.
If such a coverage section is not found in the README, `ErrNotFound` will be returned.
Expected markdown format:
## OpenConfig Path and RPC Coverage ```yaml paths: /interfaces/interface/config/description: /interfaces/interface/config/enabled: /components/component/state/name: platform_type: [ "CHASSIS" "CONTROLLER_CARD", "LINECARD", "FABRIC", ] rpcs: gnmi: gNMI.Set: union_replace: true gNMI.Subscribe: on_change: true ```
The first yaml code block after a heading line named exactly as "OpenConfig Path and RPC Coverage" will be parsed. Any other code blocks are ignored.
Types ¶
This section is empty.