opendpi

package
v0.1.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package opendpi provides OpenDPI specification types.

Index

Constants

This section is empty.

Variables

View Source
var (
	// JSON parses OpenDPI specs from JSON.
	JSON = Parser{parseJSON}
	// YAML parses OpenDPI specs from YAML.
	YAML = Parser{parseYAML}
)
View Source
var (
	// JSONWriter writes OpenDPI specs as JSON.
	JSONWriter = Writer{writeJSON, ".json"}
	// YAMLWriter writes OpenDPI specs as YAML.
	YAMLWriter = Writer{writeYaml, ".yaml"}
)

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Protocol    string
	Host        string
	Description string
	Variables   map[string]any
}

Connection represents an infrastructure endpoint where data resides.

type Info

type Info struct {
	Title       string
	Version     string
	Description string
}

Info contains metadata about the data product.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser decodes an OpenDPI spec from an io.Reader.

func (Parser) Parse

func (p Parser) Parse(r io.Reader, fsys fs.FS) (*Spec, error)

Parse decodes an OpenDPI spec from r and resolves all $ref references. External file references are not supported; use ParseFS for that.

type Port

type Port struct {
	Description string
	Connections []PortConnection
	Schema      *jsonschema.Schema
}

Port represents a data output interface exposed by the data product.

type PortConnection

type PortConnection struct {
	Connection *Connection
	Location   string
}

PortConnection represents a connection-location pair for a port.

type Spec

type Spec struct {
	OpenDPI     string
	Info        Info
	Tags        []Tag
	Connections map[string]Connection
	Ports       map[string]Port
	Schemas     map[string]*jsonschema.Schema // all schemas unified, fully resolved
}

Spec represents the root structure of an OpenDPI specification file.

type Tag

type Tag struct {
	Name        string
	Description string
}

Tag is used for categorizing ports.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer encodes an OpenDPI spec to a file.

func (Writer) Write

func (wr Writer) Write(spec *Spec, cfg *config.Config) error

Write encodes the spec to cfg.Path/opendpi.{yaml,json} based on the writer type.

Jump to

Keyboard shortcuts

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