convert

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package convert provides protocol format conversion between PSL and other formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportFromJSONSchema

func ImportFromJSONSchema(jsonContent string) (string, error)

ImportFromJSONSchema parses a JSON Schema and generates PSL.

func ImportFromProtobuf

func ImportFromProtobuf(protoContent string) (string, error)

ImportFromProtobuf parses a .proto file and generates PSL.

Types

type Converter

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

Converter handles protocol format conversions.

func NewConverter

func NewConverter(lib *protocol.Library) *Converter

NewConverter creates a new Converter.

func (*Converter) ToASN1

func (c *Converter) ToASN1(name string) (string, error)

ToASN1 converts a PSL protocol to ASN.1 notation.

func (*Converter) ToFlatBuffers

func (c *Converter) ToFlatBuffers(name string) (string, error)

ToFlatBuffers converts a PSL protocol to FlatBuffers schema.

func (*Converter) ToJSONSchema

func (c *Converter) ToJSONSchema(name string) (string, error)

ToJSONSchema converts a PSL protocol to JSON Schema.

func (*Converter) ToOpenAPI

func (c *Converter) ToOpenAPI(name string) (string, error)

ToOpenAPI converts a message PSL to OpenAPI 3.0 spec.

func (*Converter) ToProtobuf

func (c *Converter) ToProtobuf(name string) (string, error)

ToProtobuf converts a PSL protocol to Protobuf .proto format.

Jump to

Keyboard shortcuts

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