converters

package
v0.0.0-...-d389d3b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRequestCreateConverter

type APIRequestCreateConverter[T request.APIRequest, R common.EntityConstraint] interface {
	EntityOf(*T) R
}

type APIRequestUpdateConverter

type APIRequestUpdateConverter[T request.APIRequest, R common.EntityConstraint] interface {
	UpdatedEntityOf(ctx context.Context, request *T) (*R, error)
}

type APIResponseConverter

type APIResponseConverter[T any, R response.APIResponse] interface {
	ResponseOf(T) R
}

type PageableResponseConverter

type PageableResponseConverter[T any, R response.APIResponse] struct{}

func (PageableResponseConverter[T, R]) ResponseOf

func (p PageableResponseConverter[T, R]) ResponseOf(
	page *models.Page[T],
	converter APIResponseConverter[T, R],
) *response.PageableResponse[R]

Jump to

Keyboard shortcuts

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