mdocspec

package
v0.0.0-...-c4120e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package mdocspec parses yaml OC requirements from functional test READMEs.

Index

Constants

View Source
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

View Source
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.

View Source
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

func Parse(source []byte) (*ppb.OCPaths, *rpb.OCRPCs, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL