config

package
v0.1.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

View Source
const (
	JiraTokenViperKey              = "jira-token"
	JiraConfigForAccessRequestsKey = "jira-config-for-access-requests"

	JiraBaseURLDefaultValue = "https://issues.redhat.com"
)

Variables

View Source
var JiraConfigForAccessRequestsDefaultValue = AccessRequestsJiraConfiguration{
	DefaultProject:   "SDAINT",
	DefaultIssueType: "Story",
	ProdProject:      "OHSS",
	ProdIssueType:    "Incident",
	ProjectToTransitionsNames: map[string]JiraTransitionsNamesForAccessRequests{
		"SDAINT": {
			OnCreation: "In Progress",
			OnApproval: "In Progress",
			OnError:    "Closed",
		},
		"OHSS": {
			OnCreation: "Pending Customer",
			OnApproval: "New",
			OnError:    "Cancelled",
		},
	},
}

Functions

func GetConfigDirectory added in v0.1.32

func GetConfigDirectory() (string, error)

GetConfigDirectory returns the backplane config path

func GetConfigFilePath added in v0.1.4

func GetConfigFilePath() (string, error)

GetConfigFilePath returns the Backplane CLI configuration filepath

Types

type AccessRequestsJiraConfiguration added in v0.1.34

type AccessRequestsJiraConfiguration struct {
	DefaultProject            string                                           `json:"default-project"`
	DefaultIssueType          string                                           `json:"default-issue-type"`
	ProdProject               string                                           `json:"prod-project"`
	ProdIssueType             string                                           `json:"prod-issue-type"`
	ProjectToTransitionsNames map[string]JiraTransitionsNamesForAccessRequests `json:"project-to-transitions-names"`
}

type BackplaneConfiguration

type BackplaneConfiguration struct {
	URL                         string                          `json:"url"`
	ProxyURL                    *string                         `json:"proxy-url"`
	SessionDirectory            string                          `json:"session-dir"`
	AssumeInitialArn            string                          `json:"assume-initial-arn"`
	ProdEnvName                 string                          `json:"prod-env-name"`
	PagerDutyAPIKey             string                          `json:"pd-key"`
	JiraBaseURL                 string                          `json:"jira-base-url"`
	JiraToken                   string                          `json:"jira-token"`
	JiraConfigForAccessRequests AccessRequestsJiraConfiguration `json:"jira-config-for-access-requests"`
	VPNCheckEndpoint            string                          `json:"vpn-check-endpoint"`
	ProxyCheckEndpoint          string                          `json:"proxy-check-endpoint"`
}

Please update the validateConfig function if there is any required config key added

func GetBackplaneConfiguration

func GetBackplaneConfiguration() (bpConfig BackplaneConfiguration, err error)

GetBackplaneConfiguration parses and returns the given backplane configuration

func (BackplaneConfiguration) CheckAPIConnection added in v0.1.6

func (config BackplaneConfiguration) CheckAPIConnection() error

CheckAPIConnection validate API connection via configured proxy and VPN

func (*BackplaneConfiguration) GetBackplaneURL added in v0.1.21

func (config *BackplaneConfiguration) GetBackplaneURL() (string, error)

GetBackplaneURL returns API URL

type JiraTransitionsNamesForAccessRequests added in v0.1.34

type JiraTransitionsNamesForAccessRequests struct {
	OnCreation string `json:"on-creation"`
	OnApproval string `json:"on-approval"`
	OnError    string `json:"on-error"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL