mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-04-05 18:27:16 +00:00
27 lines
507 B
Go
27 lines
507 B
Go
package file
|
|
|
|
import (
|
|
"github.com/rancherfederal/hauler/internal/getter"
|
|
"github.com/rancherfederal/hauler/pkg/artifact"
|
|
)
|
|
|
|
type Option func(*file)
|
|
|
|
func WithClient(c *getter.Client) Option {
|
|
return func(f *file) {
|
|
f.client = c
|
|
}
|
|
}
|
|
|
|
func WithConfig(obj interface{}, mediaType string) Option {
|
|
return func(f *file) {
|
|
f.config = artifact.ToConfig(obj, artifact.WithConfigMediaType(mediaType))
|
|
}
|
|
}
|
|
|
|
func WithAnnotations(m map[string]string) Option {
|
|
return func(f *file) {
|
|
f.annotations = m
|
|
}
|
|
}
|