exportfmt

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtJSON = ".json"
	ExtMD   = ".md"

	FormatOASF        = "oasf"
	FormatA2A         = "a2a"
	FormatAgentSkill  = "agent-skill"
	FormatSkill       = "skill"
	FormatMCPGHCopiot = "mcp-ghcopilot"
)

Variables

View Source
var ErrUnsupportedRecord = errors.New("record does not contain the required module for this format")

ErrUnsupportedRecord indicates the record lacks the OASF module required by the requested format (e.g. asking for "a2a" on a record without integration/a2a). The request was well-formed; the data simply doesn't carry what the format reads.

Functions

func ContentTypeForExtension

func ContentTypeForExtension(ext string) string

ContentTypeForExtension returns the MIME content type for a file extension.

func KnownFormats

func KnownFormats() []string

KnownFormats returns a sorted list of all registered format names.

func RegisterFormatter

func RegisterFormatter(name string, f Formatter)

RegisterFormatter registers a named formatter. It is safe for concurrent use.

Types

type Formatter

type Formatter interface {
	// Format transforms the OASF record into the target representation.
	Format(record *corev1.Record) ([]byte, error)

	// FileExtension returns the default file extension for this format (e.g. ".json", ".md").
	FileExtension() string
}

Formatter converts an OASF record into a target format.

func GetFormatter

func GetFormatter(name string) (Formatter, error)

GetFormatter returns the formatter registered under name, or an error if not found.

Jump to

Keyboard shortcuts

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