Documentation
¶
Index ¶
- Constants
- Variables
- func CreateConfigFileDirIfNotExists() error
- func DebugViperConfig() (string, error)
- func GetAPIKey() (string, error)
- func GetBaseURL() string
- func GetEndpointURL(endpoint string) (string, error)
- func GetUserAgentHeader() string
- func ReadConfigFile(filePath string) error
- func RedactedReqInfo(req *http.Request) string
- func SaveURLToConfig(newURL string) error
- func SchemeHostOnly(longURL string) (string, error)
- func VerifyToken(datarobotEndpoint, token string) error
- type ComponentDefaults
Constants ¶
const ( // ComponentDefaultsFileName is the name of the component defaults file // This follows copier's data_file convention ComponentDefaultsFileName = ".copier-answers-defaults.yaml" // LegacyComponentDefaultsFileName is the old name for backward compatibility LegacyComponentDefaultsFileName = "component-defaults.yaml" )
const ( DataRobotURL = "endpoint" DataRobotAPIKey = "token" )
Variables ¶
var ErrInvalidURL = errors.New("Invalid URL.")
Functions ¶
func CreateConfigFileDirIfNotExists ¶
func CreateConfigFileDirIfNotExists() error
func DebugViperConfig ¶ added in v0.1.7
func GetBaseURL ¶
func GetBaseURL() string
func GetEndpointURL ¶
func GetUserAgentHeader ¶ added in v0.2.13
func GetUserAgentHeader() string
func ReadConfigFile ¶
func RedactedReqInfo ¶ added in v0.2.13
func SaveURLToConfig ¶
func SchemeHostOnly ¶ added in v0.2.7
SchemeHostOnly takes a URL like: https://app.datarobot.com/api/v2 and just returns https://app.datarobot.com (no trailing slash)
func VerifyToken ¶ added in v0.2.7
VerifyToken verifies if the datarobot endpoint + api key pair correspond to a valid pair.
Types ¶
type ComponentDefaults ¶ added in v0.2.26
ComponentDefaults holds default answers for copier templates The structure maps component repo URLs to their default answers This follows copier's data_file semantics but supports multiple repos
func LoadComponentDefaults ¶ added in v0.2.26
func LoadComponentDefaults(explicitPath string) (*ComponentDefaults, error)
LoadComponentDefaults reads the component defaults configuration file Priority order: 1. Explicitly provided path (if not empty) 2. .datarobot/.copier-answers-defaults.yaml in repo root 3. ~/.config/datarobot/.copier-answers-defaults.yaml 4. ~/.config/datarobot/component-defaults.yaml (legacy) Returns an empty config if no file exists
func (*ComponentDefaults) GetDefaultsForRepo ¶ added in v0.2.26
func (c *ComponentDefaults) GetDefaultsForRepo(repoURL string) map[string]interface{}
GetDefaultsForRepo returns the default answers for a specific repository URL Returns an empty map if no defaults are configured
func (*ComponentDefaults) MergeWithCLIData ¶ added in v0.2.26
func (c *ComponentDefaults) MergeWithCLIData(repoURL string, cliData map[string]interface{}) map[string]interface{}
MergeWithCLIData merges configured defaults with CLI-provided --data arguments CLI arguments take precedence over defaults