package
0.38.1
Repository: https://github.com/determined-ai/determined.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

AddRBACSuffix adds a "check your permission" string to errors if RBAC is enabled.
APIErrToGRPC converts internal api error categories into grpc status.Errors.
AsErrNotFound returns an error that wraps ErrNotFound, so that errors.Is can identify it.
AsValidationError returns an error that wraps ErrInvalid, so that errors.Is can identify it.
BindArgs binds path and query parameters in the context to struct fields.
BindPatch binds the request body of PATCH requests to the provided interface.
CalculatePagination calculates pagination values.
CORSWithTargetedOrigin builds on labstack/echo CORS by dynamically setting the origin header to the request's origin.
EchoErrToGRPC converts internal api error categories into grpc status.Errors.
EffectiveLimit computes a hard limit based on the offset and total available items if there is a limit set.
EffectiveOffset translated negative offsets into positive ones.
EffectiveOffsetNLimit chains EffectiveOffset and EffectiveLimit together.
ErrBatchResult returns a BatchResult with an error and no batch.
GrpcErrToEcho converts grpc status.Errors into internal api error categories.
JSONErrorHandler sends a JSON response with a single "message" key containing the error message.
NewBatchStreamProcessor creates a new BatchStreamProcessor.
NotFoundErrMsg creates a formatted message about a resource not being found.
NotFoundErrs is a wrapper function to create status.Errors with an informative message as to what category of error (NotFound), the name (trial/task/workspace etc) & the specific ID is.
OkBatchResult returns a BatchResult with a valid batch and nil error.
Paginate returns a paginated subset of the values and sets the pagination response.
Route returns an echo compatible handler for JSON requests.
Sort sorts the provided slice in place.
ToBatchOfOne wraps a single entry as a BatchOfOne that implements Batch.
WebSocketRoute upgrades incoming requests to websocket requests.
Where filters in place the provide reference to the slice.
WrapWithFallbackCode prepares errors for returning to the client by providing a fallback code and more context.

# Constants

FilterOperationGreaterThan checks if the field is greater than a value.
FilterOperationIn checks set membership.
FilterOperationInOrNull checks membership or a NULL option.
FilterOperationLessThanEqual checks if the field is less than or equal to a value.
FilterOperationStringContainment checks if the field contains a value as a substring.

# Variables

ErrAPIRemoved is an error to inform the client they are calling an old, removed API.
ErrInvalid is the inner error for errors that convert to a 400.
ErrNotFound is the inner error for errors that convert to a 404.
ErrNotImplemented is the inner error for errors that convert to a 501.
ErrUserExists is an error to inform the client that a user cannot be added to the DB since there exists a duplicate.

# Structs

BatchOfOne is a wrapper for a single log that implements Batch.
BatchRequest describes the parameters needed to target a subset of logs.
BatchResult contains either a batch or an error.
BatchStreamProcessor is an actor that fetches batches and processes them.
Filter is a general representation for a filter provided to an API.
MaybeInt allows JSON users to distinguish between absent and null values.
Pagination contains resolved pagination indices.

# Interfaces

Batch represents a batch of logs.

# Type aliases

FetchBatchFn fetches returns a batch.
FilterOperation is an operation in a filter.
OnBatchFn is a callback called on each batch.
TerminationCheckFn checks whether the log processing should stop or not.