protos

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

This file provides utilities for converting between domain objects and protobuf messages. ToProtosSlice and FromProtosSlice handle batch conversions with nil handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromProtosSlice

func FromProtosSlice[T any, S ProtoDestination[T]](t []*T, s []S) error

func FromProtosSliceFunc

func FromProtosSliceFunc[T any, S any](s []S, convert func(S) (*T, error)) ([]*T, error)

func FromProtosSliceFunc2

func FromProtosSliceFunc2[T any, S any](s []S, convert func(S) (T, error)) ([]T, error)

func ToProtosSlice

func ToProtosSlice[T any, S ProtoSource[T]](s []S) ([]*T, error)

func ToProtosSliceFunc

func ToProtosSliceFunc[T any, S any](s []S, convert func(S) (*T, error)) ([]*T, error)

Types

type ProtoDestination

type ProtoDestination[T any] interface {
	FromProtos(*T) error
}

type ProtoSource

type ProtoSource[T any] interface {
	ToProtos() (*T, error)
}

Jump to

Keyboard shortcuts

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