options.go 690 Bytes
Newer Older
songlinfeng's avatar
songlinfeng committed
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
/**
# Copyright (c) 2024, HCUOpt CORPORATION.  All rights reserved.
**/

package root

// Option defines a functional option for configuring a transormer.
type Option func(*builder)

// WithRoot sets the (from) root for the root transformer.
func WithRoot(root string) Option {
	return func(b *builder) {
		b.root = root
	}
}

// WithTargetRoot sets the (to) target root for the root transformer.
func WithTargetRoot(root string) Option {
	return func(b *builder) {
		b.targetRoot = root
	}
}

// WithRelativeTo sets whether the specified root is relative to the host or container.
func WithRelativeTo(relativeTo string) Option {
	return func(b *builder) {
		b.relativeTo = relativeTo
	}
}