Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorOr ¶
func ErrorOr[T any](logger *zap.Logger, res *connect.Response[T], err error) (*connect.Response[T], error)
ErrorOr returns a grpc error if err is not nil. Otherwise, returns res. If err is app.ErrInvalidArgument, returns codes.InvalidArgument. If err is app.ErrNotFound, returns codes.NotFound. Otherwise, returns codes.Unknown.
func PageToken ¶
func PageToken(p *v1.Pagination) (string, error)
PageToken returns a page token from the pagination object. If the pagination object is nil, it returns an empty string. It means that the last page is returned.
func Pagination ¶
func Pagination(req listRequest) (*v1.Pagination, error)
Pagination returns a pagination object from the list request. If the page token is empty, it returns nil. It means that the first page is requested. If the page token is invalid, it returns app.ErrInvalidArgument.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.