-
Notifications
You must be signed in to change notification settings - Fork 62
/
options.go
31 lines (27 loc) · 882 Bytes
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
// Licensed under the BSD-3-Clause License (the "License").
// You may not use this file except in compliance with the License.
package initrd
type InitrdOptions struct {
output string
cacheDir string
}
type InitrdOption func(*InitrdOptions) error
// WithOutput sets the location of the output location of the resulting CPIO
// archive file.
func WithOutput(output string) InitrdOption {
return func(opts *InitrdOptions) error {
opts.output = output
return nil
}
}
// WithCacheDir sets the path of an internal location that's used during the
// serialization of the initramfs as a mechanism for storing temporary files
// used as cache.
func WithCacheDir(dir string) InitrdOption {
return func(opts *InitrdOptions) error {
opts.cacheDir = dir
return nil
}
}