Documentation
¶
Index ¶
- func CurrentActor(ctx context.Context) common.User
- func DefaultOperationSecurity() []map[string][]string
- func DownloadResponse(reader io.ReadCloser, size int64, filename string) *huma.StreamResponse
- func MapOneAPIResponse[S any, D any](source S, mappingMessage func(error) string) (base.ApiResponse[D], error)
- func Operation(operationID, method, path, summary, description string, tags ...string) huma.Operation
- func PaginationParams(start, limit int, sortCol, sortDir, search string) pagination.QueryParams
- func PaginationResponse(p pagination.Response) base.PaginationResponse
- func ParseMultipartJSONPart[T any](form multipart.Form, partName string) (T, error)
- func ReadWorkspaceUploads(form multipart.Form, maxFileSizeBytes int64) (map[int][]byte, error)
- func RegisterSecured[I, O any](api huma.API, op huma.Operation, permission string, ...)
- func RequireUser(ctx context.Context) (*common.User, error)
- func SessionMetaFromContext(ctx context.Context, userAgent string) auth.SessionMeta
- func TranslateRemoteProxyError(err error) error
- func WorkspaceMultipartRequestBody(manifestDescription string) *huma.RequestBody
- type ActivityAppContext
- type Out
- type Page
- type RemoteJSONProxy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadResponse ¶ added in v2.10.2
func DownloadResponse(reader io.ReadCloser, size int64, filename string) *huma.StreamResponse
DownloadResponse streams an attachment and closes its reader when streaming ends.
func MapOneAPIResponse ¶
func PaginationParams ¶
func PaginationParams(start, limit int, sortCol, sortDir, search string) pagination.QueryParams
PaginationParams converts query parameters to pagination.QueryParams. A limit of -1 means "show all items" (no pagination).
func PaginationResponse ¶
func PaginationResponse(p pagination.Response) base.PaginationResponse
PaginationResponse converts the pagination package's response into the API response shape.
func ParseMultipartJSONPart ¶
ParseMultipartJSONPart decodes one required JSON-valued multipart field.
func ReadWorkspaceUploads ¶
ReadWorkspaceUploads reads and validates text files from a workspace multipart request.
func RegisterSecured ¶
func RequireUser ¶
RequireUser returns the authenticated user from the request context or a 401 error.
func SessionMetaFromContext ¶
func SessionMetaFromContext(ctx context.Context, userAgent string) auth.SessionMeta
SessionMetaFromContext builds the session metadata recorded on login.
func TranslateRemoteProxyError ¶
TranslateRemoteProxyError converts environment transport failures into Huma errors.
func WorkspaceMultipartRequestBody ¶
func WorkspaceMultipartRequestBody(manifestDescription string) *huma.RequestBody
WorkspaceMultipartRequestBody describes the shared workspace multipart schema.
Types ¶
type ActivityAppContext ¶
type ActivityAppContext struct {
// contains filtered or unexported fields
}
ActivityAppContext carries the app lifecycle context through handler registration.
func NewActivityAppContext ¶
func NewActivityAppContext(ctx context.Context) ActivityAppContext
NewActivityAppContext wraps the app lifecycle context for handler constructors.
func (ActivityAppContext) Context ¶
func (c ActivityAppContext) Context() context.Context
Context returns the wrapped app lifecycle context.
type Out ¶ added in v2.10.0
type Out[T any] struct { Body base.ApiResponse[T] }
Out is the huma response envelope for endpoints returning base.ApiResponse[T]. It replaces the per-endpoint `type XxxOutput struct { Body base.ApiResponse[T] }` wrappers; outputs carrying extra fields (headers, status) keep their own type.
type Page ¶ added in v2.10.0
Page is the huma response envelope for endpoints returning base.Paginated[T].
type RemoteJSONProxy ¶
RemoteJSONProxy is the remote environment transport operation used by domain handlers.