pbmap

package
v1.4.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurationProtoToDuration

func DurationProtoToDuration(v *durationpb.Duration) *time.Duration

DurationProtoToDuration converts *durationpb.Duration to *time.Duration.

func DurationToDurationProto

func DurationToDurationProto(v *time.Duration) *durationpb.Duration

DurationToDurationProto converts *time.Duration to *durationpb.Duration.

func FromInt64Ptr

func FromInt64Ptr(v *int64) *int

FromInt64Ptr converts *int64 to *int.

func FromInt64Slice

func FromInt64Slice(vs []int64) []int

FromInt64Slice converts []int64 to []int.

func FromUint64Ptr

func FromUint64Ptr(v *uint64) *uint

FromUint64Ptr converts *uint64 to *uint.

func MapToProtoStruct

func MapToProtoStruct(m map[string]any) *structpb.Struct

MapToProtoStruct converts map[string]any to *structpb.Struct. Returns nil on conversion failure (e.g. non-UTF-8 keys or unsupported value types).

func PostFromProto

func PostFromProto(p *entpb.Post) *domain.Post

PostFromProto converts *entpb.Post to *domain.Post.

func PostListFromProto

func PostListFromProto(ps []*entpb.Post) domain.PostList

PostListFromProto converts []*entpb.Post to domain.PostList.

func PostListToProto

func PostListToProto(ds domain.PostList) []*entpb.Post

PostListToProto converts domain.PostList to []*entpb.Post.

func PostToProto

func PostToProto(d *domain.Post) *entpb.Post

PostToProto converts *domain.Post to *entpb.Post.

func ProtoStringToUUIDPtr

func ProtoStringToUUIDPtr(v *string) *uuid.UUID

ProtoStringToUUIDPtr converts *string to *uuid.UUID. Returns nil on malformed UUID input rather than panicking — protobuf payloads can carry untrusted strings and must not crash the process.

func ProtoStructToMap

func ProtoStructToMap(s *structpb.Struct) map[string]any

ProtoStructToMap converts *structpb.Struct to map[string]any.

func StringSliceToUUIDSlice

func StringSliceToUUIDSlice(vs []string) []uuid.UUID

StringSliceToUUIDSlice converts []string to []uuid.UUID. Malformed entries yield uuid.Nil at their index rather than panicking.

func TagFromProto

func TagFromProto(p *entpb.Tag) *domain.Tag

TagFromProto converts *entpb.Tag to *domain.Tag.

func TagListFromProto

func TagListFromProto(ps []*entpb.Tag) domain.TagList

TagListFromProto converts []*entpb.Tag to domain.TagList.

func TagListToProto

func TagListToProto(ds domain.TagList) []*entpb.Tag

TagListToProto converts domain.TagList to []*entpb.Tag.

func TagToProto

func TagToProto(d *domain.Tag) *entpb.Tag

TagToProto converts *domain.Tag to *entpb.Tag.

func TimeToTimestampProto

func TimeToTimestampProto(v *time.Time) *timestamppb.Timestamp

TimeToTimestampProto converts *time.Time to *timestamppb.Timestamp.

func TimestampProtoToTime

func TimestampProtoToTime(v *timestamppb.Timestamp) *time.Time

TimestampProtoToTime converts *timestamppb.Timestamp to *time.Time.

func ToInt64Ptr

func ToInt64Ptr(v *int) *int64

ToInt64Ptr converts *int to *int64.

func ToInt64Slice

func ToInt64Slice(vs []int) []int64

ToInt64Slice converts []int to []int64.

func ToUint64Ptr

func ToUint64Ptr(v *uint) *uint64

ToUint64Ptr converts *uint to *uint64.

func UserFromProto

func UserFromProto(p *entpb.User) *domain.User

UserFromProto converts *entpb.User to *domain.User.

func UserListFromProto

func UserListFromProto(ps []*entpb.User) domain.UserList

UserListFromProto converts []*entpb.User to domain.UserList.

func UserListToProto

func UserListToProto(ds domain.UserList) []*entpb.User

UserListToProto converts domain.UserList to []*entpb.User.

func UserMetadataFromProto

func UserMetadataFromProto(p *entpb.UserMetadata) domain.UserMetadata

func UserMetadataToProto

func UserMetadataToProto(m domain.UserMetadata) *entpb.UserMetadata

func UserToProto

func UserToProto(d *domain.User) *entpb.User

UserToProto converts *domain.User to *entpb.User.

func UuidPtrToProtoString

func UuidPtrToProtoString(v *uuid.UUID) *string

UuidPtrToProtoString converts *uuid.UUID to *string.

func UuidSliceToStringSlice

func UuidSliceToStringSlice(vs []uuid.UUID) []string

UuidSliceToStringSlice converts []uuid.UUID to []string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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