diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-02-25 17:50:50 +0100 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2023-02-25 17:50:50 +0100 |
| commit | 9dbdf08cb814a32ebb27d200391af83c6f2a7ff5 (patch) | |
| tree | 6fff3e789cdea402113e8705edb739c26dd973f2 /aoc/day.go | |
| parent | cc446240fac48c545c522f3d69c5d04a93b63461 (diff) | |
start scaffolding and boilerplate
Diffstat (limited to 'aoc/day.go')
| -rw-r--r-- | aoc/day.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/aoc/day.go b/aoc/day.go new file mode 100644 index 0000000..7505223 --- /dev/null +++ b/aoc/day.go @@ -0,0 +1,19 @@ +package aoc + +import ( + "bufio" + "context" +) + +type Reader[T any] interface { + Read(ctx context.Context, scanner *bufio.Scanner) (T, error) +} + +type Solver[T any, R any] interface { + Solve(ctx context.Context, data T) (R, error) +} + +func RunDay[T any, R any](ctx context.Context, in Reader[T], solvers ...Solver[T, R]) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() +} |
