Documentation ¶
Index ¶
- func CalculateFileChunks(r io.Reader, delimiter byte, res chan<- FileChunkCalculationResult)
- func FmtBytesHumanReadable(bytes float32) string
- func FmtDurationHumanReadable(d time.Duration) string
- func FmtOperationOutcomes(outcome []*fm.OperationOutcome) string
- func Indent(spaces int, v string) string
- func IndentExceptFirstLine(spaces int, v string) string
- type DurationStatistics
- type ErrorResponse
- type FileChunk
- type FileChunkCalculationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateFileChunks ¶
func CalculateFileChunks(r io.Reader, delimiter byte, res chan<- FileChunkCalculationResult)
CalculateFileChunks calculates all chunks of r that are delimited by delimiter. r is read in a streamed fashion. Results will be published on a res channel as they appear when reading r. Closes the result channel as soon as r is exhaustively read.
func FmtBytesHumanReadable ¶ added in v0.5.0
FmtBytesHumanReadable takes an amount of bytes and returns them in a human readable form up to a unit of PiB.
func FmtDurationHumanReadable ¶ added in v0.5.0
FmtDurationHumanReadable takes a duration and returns it in a human readable form. This is basically equivalent to time.Duration.Round(time.Second) with the following differences:
- durations under a minute get printed with millisecond precision
- durations equal or above a minute get printed with second precision
func FmtOperationOutcomes ¶ added in v0.8.2
func FmtOperationOutcomes(outcome []*fm.OperationOutcome) string
func IndentExceptFirstLine ¶ added in v0.8.6
Types ¶
type DurationStatistics ¶ added in v0.5.0
DurationStatistics represents statistics about measured durations. Comprises information about the mean and max as well as different percentiles (50, 95 and 99).
func CalculateDurationStatistics ¶ added in v0.5.0
func CalculateDurationStatistics(durations []float64) DurationStatistics
Calculates the DurationStatistics for a set of given durations.
type ErrorResponse ¶ added in v0.5.0
type ErrorResponse struct { StatusCode int OperationOutcome *fm.OperationOutcome OtherError string }
ErrorResponse represents an error returned from the FHIR server.
func (*ErrorResponse) String ¶ added in v0.5.0
func (errRes *ErrorResponse) String() string
String returns the ErrorResponse in a default formatted way.
type FileChunk ¶
FileChunk describes a chunk within a file with its starting position and end position in bytes. Both are given as bytes counted from the file's beginning. Also carries information about the chunk number (i.e. its order position) within the file.
type FileChunkCalculationResult ¶
FileChunkCalculationResult represents a single result of a file chunk calculation. Carries information about a FileChunk and additional error information. A FileChunk can still hold valuable information even in the presence of an error such as the chunk number.