handlerutil

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: BSD-3-Clause Imports: 20 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIError

func APIError(err error) huma.StatusError

func CurrentActor

func CurrentActor(ctx context.Context) types.Actor

func CurrentUserFromContext

func CurrentUserFromContext(ctx context.Context) (*types.Actor, bool)

func DefaultOperationSecurity

func DefaultOperationSecurity() []map[string][]string

func DownloadResponse

func DownloadResponse(reader io.ReadCloser, size int64, filename string) *huma.StreamResponse

func FeatureDisabledError

func FeatureDisabledError(id types.FeatureID) *types.FeatureDisabledError

func MapOneAPIResponse

func MapOneAPIResponse[S, D any](source S, mappingMessage func(error) string) (types.ApiResponse[D], error)

func Operation

func Operation(operationID, method, path, summary, description string, tags ...string) huma.Operation

func PaginationParams

func PaginationParams(start, limit int, sortCol, sortDir, search string) pagination.QueryParams

A limit of -1 means "show all items" (no pagination).

func ParseMultipartJSONPart

func ParseMultipartJSONPart[T any](form multipart.Form, partName string) (T, error)

func PasswordPolicyProblem

func PasswordPolicyProblem(err error) huma.StatusError

func ReadWorkspaceUploads

func ReadWorkspaceUploads(form multipart.Form, maxFileSizeBytes int64) (map[int][]byte, error)

func RegisterSecured

func RegisterSecured[I, O any](
	api huma.API,
	op huma.Operation,
	permission string,
	handler func(context.Context, *I) (*O, error),
)

func RequireUser

func RequireUser(ctx context.Context) (*types.Actor, error)

func SessionMetaFromContext

func SessionMetaFromContext(ctx context.Context, userAgent string) types.SessionMeta

func TranslateRemoteProxyError

func TranslateRemoteProxyError(err error) error

func WorkspaceMultipartRequestBody

func WorkspaceMultipartRequestBody(manifestDescription string) *huma.RequestBody

Types

type ActivityAppContext

type ActivityAppContext struct {
	// contains filtered or unexported fields
}

func NewActivityAppContext

func NewActivityAppContext(ctx context.Context) ActivityAppContext

func (ActivityAppContext) Context

func (c ActivityAppContext) Context() context.Context

type Out

type Out[T any] struct {
	Body types.ApiResponse[T]
}

func MessageOutput

func MessageOutput(message, activityID string) *Out[types.MessageResponse]

type Page

type Page[T any] struct {
	Body types.Paginated[T]
}

type ProblemError

type ProblemError struct {
	*huma.ErrorModel

	Details any `json:"details,omitempty"`
}

type RemoteJSONProxy

type RemoteJSONProxy func(context.Context, string, string, string, []byte, any) error

func (RemoteJSONProxy) JSON

func (p RemoteJSONProxy) JSON[T any](
	ctx context.Context,
	environmentID string,
	method string,
	path string,
	requestBody any,
) (*T, error)

Jump to

Keyboard shortcuts

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