openslosdk

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package openslosdk provides utilities for working with openslo.Object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader, format ObjectFormat) ([]openslo.Object, error)

Decode reads objects from io.Reader and decodes them, according to the provided ObjectFormat, into a slice of openslo.Object.

func Encode

func Encode(out io.Writer, format ObjectFormat, objects ...openslo.Object) error

Encode writes the provided openslo.Object to io.Writer, according to the provided ObjectFormat.

func FilterByKind

func FilterByKind[T openslo.Object](objects []openslo.Object) []T

FilterByKind filters openslo.Object slice and returns its subset matching the type constraint.

func Validate

func Validate(objects ...openslo.Object) error

Types

type ObjectFormat

type ObjectFormat int

ObjectFormat represents the serialization format of openslo.Object.

const (
	FormatYAML ObjectFormat = iota + 1
	FormatJSON
)

func (ObjectFormat) String

func (f ObjectFormat) String() string

String implements the fmt.Stringer interface.

func (ObjectFormat) Validate

func (f ObjectFormat) Validate() error

Validate checks if ObjectFormat is supported.

Jump to

Keyboard shortcuts

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