durchunk

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package durchunk provides functions to split a map of key-durations into balanced chunks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	Keys  []string      `json:"keys"`
	Total time.Duration `json:"total_seconds"`
}

Chunk chunk after balanced split

func SplitBalanced

func SplitBalanced(data iter.Seq2[string, time.Duration], chunkCount int) []Chunk

SplitBalanced は map[string]time.Duration を指定したチャンク数に分割します。 - 合計時間を均等化 - 要素数に制約なし(最低1個以上)

Jump to

Keyboard shortcuts

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