pb

package
v0.0.0-...-e0772cd Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package pb contains various utils and helps to work with our protobuf messages. It contains various mappers that map our convention to other public standards.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJson

func FromJson[T proto.Message](reader io.Reader, obj T) error

Deserialize a protocol buffers message from JSON.

func FromYaml

func FromYaml[T proto.Message](reader io.Reader, obj T) error

Deserialize a protocol buffers message from YAML. Internally it converts the YAML to JSON and then unmarshals the JSON.

func NewPurlPackageVersion

func NewPurlPackageVersion(purl string) (*purlPackageVersionHelper, error)

func ToJson

func ToJson[T proto.Message](obj T, indent string) ([]byte, error)

Serialize a protocol buffers message to JSON. This function explicitly uses the proto field names for JSON keys.

func ToYaml

func ToYaml[T proto.Message](writer io.Writer, obj T) error

Serialize a protocol buffers message to YAML. Internally it converts the message to JSON and then converts the JSON to YAML.

Types

This section is empty.

Jump to

Keyboard shortcuts

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