convert

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Copyright (c) 2024 Eli Janssen Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

Copyright (c) 2024 Eli Janssen Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

Copyright (c) 2024 Eli Janssen Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeToTimestamp

func TimeToTimestamp(t time.Time) *timestamppb.Timestamp

func TimeToTimestampTZ

func TimeToTimestampTZ(t time.Time) *icbt.TimestampTZ

func ToConnectRpcError added in v1.1.0

func ToConnectRpcError(src errs.Error) *connect.Error

func ToPbEarmark

func ToPbEarmark(ctx context.Context, svc service.Servicer, src *model.Earmark) (dst *icbt.Earmark, err error)

func ToPbEvent

func ToPbEvent(src *model.Event) (dst *icbt.Event)

func ToPbEventItem

func ToPbEventItem(src *model.EventItem) (dst *icbt.EventItem)

func ToPbList

func ToPbList[T any, V any](converter func(*T) *V, in []*T) []*V

func ToPbListWithService

func ToPbListWithService[T any, V any](ctx context.Context, converter func(context.Context, service.Servicer, *T) (*V, error), svc service.Servicer, in []*T) ([]*V, error)

func ToPbNotification

func ToPbNotification(src *model.Notification) (dst *icbt.Notification)

func ToPbPagination

func ToPbPagination(src *service.Pagination) (dst *icbt.PaginationResult)

Types

type Convergen

type Convergen interface {
	// :typecast
	// :stringer
	// :case:off
	// :conv TimeToTimestamp Created Created
	ToPbNotification(*model.Notification) *icbt.Notification

	// :typecast
	// :stringer
	// :case:off
	// :conv TimeToTimestamp Created Created
	// :conv TimeToTimestampTZ When() When
	ToPbEvent(*model.Event) *icbt.Event

	// :typecast
	// :stringer
	// :case:off
	// :conv TimeToTimestamp Created Created
	ToPbEventItem(*model.EventItem) *icbt.EventItem
}

Jump to

Keyboard shortcuts

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