-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Avi Deitcher <avi@deitcher.net>
- Loading branch information
Showing
10 changed files
with
98 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package source | ||
|
||
type sourceOpt struct { | ||
name string | ||
version string | ||
platform string | ||
defaultImageSource string | ||
base string | ||
} | ||
type Option func(*sourceOpt) error | ||
|
||
func WithName(name string) Option { | ||
return func(s *sourceOpt) error { | ||
s.name = name | ||
return nil | ||
} | ||
} | ||
|
||
func WithPlatform(platform string) Option { | ||
return func(s *sourceOpt) error { | ||
s.platform = platform | ||
return nil | ||
} | ||
} | ||
|
||
func WithVersion(version string) Option { | ||
return func(s *sourceOpt) error { | ||
s.version = version | ||
return nil | ||
} | ||
} | ||
|
||
func WithDefaultImageSource(defaultImageSource string) Option { | ||
return func(s *sourceOpt) error { | ||
s.defaultImageSource = defaultImageSource | ||
return nil | ||
} | ||
} | ||
|
||
func WithBasePath(base string) Option { | ||
return func(s *sourceOpt) error { | ||
s.base = base | ||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters