config

package
v1.1.33 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 25 Imported by: 35

Documentation

Index

Constants

View Source
const (
	ManualApproval  string = "manual"
	AutoApproval    string = "auto"
	WebhookApproval string = "webhook"
)

subscription approval types

View Source
const (
	NotifySMTP    = NotificationType("SMTP")
	NotifyWebhook = NotificationType("WEBHOOK")
)

NotificationTypes

View Source
const (
	AnonymousAuth = SMTPAuthType("ANONYMOUS")
	LoginAuth     = SMTPAuthType("LOGIN")
	PlainAuth     = SMTPAuthType("PLAIN")
	NoAuth        = SMTPAuthType("NONE")
)

SMTPAuthTypes -

Variables

View Source
var (
	ErrBadConfig                 = configerrors.Newf(1401, "error with config %v, please set and/or check its value")
	ErrEnvConfigOverride         = configerrors.New(1402, "error in overriding configuration using environment variables")
	ErrStatusHealthCheckPeriod   = configerrors.New(1403, "invalid value for statusHealthCheckPeriod. Value must be between 1 and 5 minutes")
	ErrStatusHealthCheckInterval = configerrors.New(1404, "invalid value for statusHealthCheckInterval. Value must be between 30 seconds and 5 minutes")
	ErrReadingKeyFile            = configerrors.Newf(1405, "could not read the %v key file %v")
	ErrServiceAccount            = configerrors.New(1406, "using a DOSA_* service account with Marketplace Provisioning is unsupported")
)

Errors hit when validating or parsing config

View Source
var AgentDataPlaneType string

AgentDataPlaneType - Holds the data plane type of agent

View Source
var AgentDisplayName string

AgentDisplayName - Holds the name Agent name for displaying in version command or elsewhere

View Source
var AgentLatestVersion string

AgentLatestVersion - Holds the latest version of the agent

View Source
var AgentTypeName string

AgentTypeName - Holds the name Agent type

View Source
var AgentVersion string

AgentVersion - Holds the version of agent

View Source
var SDKVersion string

SDKVersion - Holds the version of SDK

TLSDefaultCipherSuites - list of suites to use by default

Functions

func AddAgentFeaturesConfigProperties

func AddAgentFeaturesConfigProperties(props properties.Properties)

AddAgentFeaturesConfigProperties - Adds the command properties needed for Agent Features Config

func AddCategoryConfigProperties

func AddCategoryConfigProperties(props properties.Properties, basePath string)

AddCategoryConfigProperties -

func AddCentralConfigProperties

func AddCentralConfigProperties(props properties.Properties, agentType AgentType)

AddCentralConfigProperties - Adds the command properties needed for Central Config

func AddLogConfigProperties

func AddLogConfigProperties(props properties.Properties, defaultFileName string)

AddLogConfigProperties - Adds the command properties needed for Log Config

func AddMigrationConfigProperties

func AddMigrationConfigProperties(props properties.Properties)

AddMigrationConfigProperties - Adds the command properties needed for Migration Config

func AddStatusConfigProperties

func AddStatusConfigProperties(props properties.Properties)

AddStatusConfigProperties - Adds the command properties needed for Status Config

func AddSubscriptionConfigProperties

func AddSubscriptionConfigProperties(props properties.Properties)

AddSubscriptionConfigProperties -

func AddUsageReportingProperties

func AddUsageReportingProperties(props properties.Properties)

AddUsageReportingProperties - Adds the command properties needed for Uage Reporting Settings

func IsCategoryAutocreationEnabled

func IsCategoryAutocreationEnabled() bool

IsCategoryAutocreationEnabled - return true when the global auto creation of categories is enabled

func IsMappingConfigured

func IsMappingConfigured() bool

IsMappingConfigured - return true when category mappings have been configured

func LogConfigOverrides

func LogConfigOverrides() []cfgfile.ConditionalOverride

LogConfigOverrides - override the filebeat config options

func TLSDefaultCipherSuitesStringSlice

func TLSDefaultCipherSuitesStringSlice() []string

TLSDefaultCipherSuitesStringSlice - list of suites to use by default

func TLSDefaultMinVersionString

func TLSDefaultMinVersionString() string

TLSDefaultMinVersionString - get the default min version string

func ValidateConfig

func ValidateConfig(cfg interface{}) error

ValidateConfig - Validates the agent config Uses reflection to get the IConfigValidator interface on the config struct or struct variable. Makes call to ValidateCfg method except if the struct variable is of CentralConfig type as the validation for CentralConfig is already done during parseCentralConfig

Types

type AgentFeaturesConfig

type AgentFeaturesConfig interface {
	ConnectionToCentralEnabled() bool
	ProcessSystemSignalsEnabled() bool
	VersionCheckerEnabled() bool
	PersistCacheEnabled() bool
	MarketplaceProvisioningEnabled() bool
	GetExternalIDPConfig() ExternalIDPConfig
	AgentStatusUpdatesEnabled() bool
}

AgentFeaturesConfig - Interface to get agent features Config

func NewAgentFeaturesConfiguration

func NewAgentFeaturesConfiguration() AgentFeaturesConfig

NewAgentFeaturesConfiguration - Creates the default agent features config

func ParseAgentFeaturesConfig

func ParseAgentFeaturesConfig(props properties.Properties) (AgentFeaturesConfig, error)

ParseAgentFeaturesConfig - Parses the AgentFeatures Config values from the command line

type AgentFeaturesConfiguration

type AgentFeaturesConfiguration struct {
	AgentFeaturesConfig
	IConfigValidator
	ConnectToCentral        bool              `config:"connectToCentral"`
	ProcessSystemSignals    bool              `config:"processSystemSignals"`
	VersionChecker          bool              `config:"versionChecker"`
	PersistCache            bool              `config:"persistCache"`
	MarketplaceProvisioning bool              `config:"marketplaceProvisioning"`
	ExternalIDPConfig       ExternalIDPConfig `config:"idp"`
	AgentStatusUpdates      bool              `config:"agentStatusUpdates"`
}

AgentFeaturesConfiguration - Structure to hold the agent features config

func (*AgentFeaturesConfiguration) AgentStatusUpdatesEnabled

func (c *AgentFeaturesConfiguration) AgentStatusUpdatesEnabled() bool

AgentStatusUpdatesEnabled - True if the agent SDK should manage the status update.

func (*AgentFeaturesConfiguration) ConnectionToCentralEnabled

func (c *AgentFeaturesConfiguration) ConnectionToCentralEnabled() bool

ConnectionToCentralEnabled - True if the agent is a standard agent that connects to Central

func (*AgentFeaturesConfiguration) GetExternalIDPConfig

func (c *AgentFeaturesConfiguration) GetExternalIDPConfig() ExternalIDPConfig

GetExternalIDPConfig - returns the config for external IdP providers

func (*AgentFeaturesConfiguration) MarketplaceProvisioningEnabled

func (c *AgentFeaturesConfiguration) MarketplaceProvisioningEnabled() bool

MarketplaceProvisioningEnabled - True if the agent SDK should handle marketplace subscriptions.

func (*AgentFeaturesConfiguration) PersistCacheEnabled

func (c *AgentFeaturesConfiguration) PersistCacheEnabled() bool

PersistCacheEnabled - True if the agent SDK should use persistence for agent cache.

func (*AgentFeaturesConfiguration) ProcessSystemSignalsEnabled

func (c *AgentFeaturesConfiguration) ProcessSystemSignalsEnabled() bool

ProcessSystemSignalsEnabled - True if the agent SDK listens for system signals and manages shutdown

func (*AgentFeaturesConfiguration) ValidateCfg

func (c *AgentFeaturesConfiguration) ValidateCfg() (err error)

ValidateCfg - Validates the config, implementing IConfigInterface

func (*AgentFeaturesConfiguration) VersionCheckerEnabled

func (c *AgentFeaturesConfiguration) VersionCheckerEnabled() bool

VersionCheckerEnabled - True if the agent SDK should check for newer versions of the agent.

type AgentType

type AgentType int

AgentType - Defines the type of agent

const (
	// DiscoveryAgent - Type definition for discovery agent
	DiscoveryAgent AgentType = iota + 1
	// TraceabilityAgent - Type definition for traceability agent
	TraceabilityAgent
	// GovernanceAgent - Type definition for governance agent
	GovernanceAgent
	// GenericService - Type for a generic service
	GenericService
)

type ApprovalConfig

type ApprovalConfig struct {
	SubscriptionApprovalMode    string        `config:"mode"`
	SubscriptionApprovalWebhook WebhookConfig `config:"webhook"`
}

ApprovalConfig -

type AuthConfig

type AuthConfig interface {
	GetTokenURL() string
	GetRealm() string
	GetAudience() string
	GetClientID() string
	GetPrivateKey() string
	GetPublicKey() string
	GetKeyPassword() string
	GetTimeout() time.Duration
	// contains filtered or unexported methods
}

AuthConfig - Interface for service account config

type AuthConfiguration

type AuthConfiguration struct {
	AuthConfig
	URL            string        `config:"url"`
	Realm          string        `config:"realm"`
	ClientID       string        `config:"clientId"`
	PrivateKey     string        `config:"privateKey"`
	PublicKey      string        `config:"publicKey"`
	PrivateKeyData string        `config:"privateKeyData"`
	PublicKeyData  string        `config:"publicKeyData"`
	KeyPwd         string        `config:"keyPassword"`
	Timeout        time.Duration `config:"timeout"`
}

AuthConfiguration -

func (*AuthConfiguration) GetAudience

func (a *AuthConfiguration) GetAudience() string

GetAudience - Returns the token audience URL

func (*AuthConfiguration) GetClientID

func (a *AuthConfiguration) GetClientID() string

GetClientID - Returns the token audience URL

func (*AuthConfiguration) GetKeyPassword

func (a *AuthConfiguration) GetKeyPassword() string

GetKeyPassword - Returns the token audience URL

func (*AuthConfiguration) GetPrivateKey

func (a *AuthConfiguration) GetPrivateKey() string

GetPrivateKey - Returns the private key file path

func (*AuthConfiguration) GetPublicKey

func (a *AuthConfiguration) GetPublicKey() string

GetPublicKey - Returns the public key file path

func (*AuthConfiguration) GetRealm

func (a *AuthConfiguration) GetRealm() string

GetRealm - Returns the token audience URL

func (*AuthConfiguration) GetTimeout

func (a *AuthConfiguration) GetTimeout() time.Duration

GetTimeout - Returns the token audience URL

func (*AuthConfiguration) GetTokenURL

func (a *AuthConfiguration) GetTokenURL() string

GetTokenURL - Returns the token URL

type CategoryConfig

type CategoryConfig interface {
	IsAutocreationEnabled() bool
	IsConfigured() bool
	DetermineCategories(tags map[string]string) []string
	GetStaticCategories() []string
}

CategoryConfig - Interface to get category config

func ParseCategoryConfig

func ParseCategoryConfig(props properties.Properties, basePath string) CategoryConfig

ParseCategoryConfig -

type CategoryConfiguration

type CategoryConfiguration struct {
	Mappings     []*mapping `config:"mappings"`
	Autocreation bool       `config:"autocreation"`
	// contains filtered or unexported fields
}

CategoryConfiguration -

func (*CategoryConfiguration) DetermineCategories

func (c *CategoryConfiguration) DetermineCategories(tags map[string]string) []string

DetermineCategories - return a string array of all categories that match the configured conditions

func (*CategoryConfiguration) GetStaticCategories

func (c *CategoryConfiguration) GetStaticCategories() []string

GetStaticCategories - returns the array of the static categories for all the mappings

func (*CategoryConfiguration) IsAutocreationEnabled

func (c *CategoryConfiguration) IsAutocreationEnabled() bool

IsAutocreationEnabled - return true when the auto creation of categories is enabled

func (*CategoryConfiguration) IsConfigured

func (c *CategoryConfiguration) IsConfigured() bool

IsConfigured - return true when the auto creation of categories is enabled

type CentralConfig

type CentralConfig interface {
	GetAgentType() AgentType
	GetTenantID() string
	GetAPICDeployment() string
	GetEnvironmentID() string
	SetEnvironmentID(environmentID string)
	IsAxwayManaged() bool
	SetAxwayManaged(isAxwayManaged bool)
	GetEnvironmentName() string
	GetAgentName() string
	GetTeamName() string
	GetTeamID() string
	SetTeamID(teamID string)
	GetURL() string
	GetPlatformURL() string
	GetCatalogItemsURL() string
	GetAPIServerURL() string
	GetEnvironmentURL() string
	GetEnvironmentACLsURL() string
	GetServicesURL() string
	GetRevisionsURL() string
	GetInstancesURL() string
	DeleteServicesURL() string
	GetConsumerInstancesURL() string
	GetAPIServerSubscriptionDefinitionURL() string
	GetAPIServerAccessRequestDefinitionURL() string
	GetAPIServerWebhooksURL() string
	GetAPIServerSecretsURL() string
	GetCategoriesURL() string
	GetSubscriptionURL() string
	GetSubscriptionConfig() SubscriptionConfig
	GetAccessRequestsURL() string
	GetAccessRequestURL(string) string
	GetAccessRequestStateURL(string) string
	GetCatalogItemSubscriptionsURL(string) string
	GetCatalogItemSubscriptionStatesURL(string, string) string
	GetCatalogItemSubscriptionPropertiesURL(string, string) string
	GetCatalogItemSubscriptionRelationshipURL(string, string) string
	GetCatalogItemSubscriptionDefinitionPropertiesURL(string) string
	GetAuthConfig() AuthConfig
	GetTLSConfig() TLSConfig
	GetTagsToPublish() string
	GetProxyURL() string
	GetPollInterval() time.Duration
	GetReportActivityFrequency() time.Duration
	GetJobExecutionTimeout() time.Duration
	GetClientTimeout() time.Duration
	GetAPIServiceRevisionPattern() string
	GetCatalogItemByIDURL(catalogItemID string) string
	GetAppendEnvironmentToTitle() bool
	GetUsageReportingConfig() UsageReportingConfig
	IsUsingGRPC() bool
	GetGRPCHost() string
	GetGRPCPort() int
	IsGRPCInsecure() bool
	IsFetchOnStartupEnabled() bool
	GetFetchOnStartupPageSize() int
	GetFetchOnStartupRetention() time.Duration
	GetCacheStoragePath() string
	GetCacheStorageInterval() time.Duration
	SetIsMarketplaceSubsEnabled(enabled bool)
	IsMarketplaceSubsEnabled() bool
	GetSingleURL() string
	GetMigrationSettings() MigrationConfig
	GetWatchResourceFilters() []ResourceFilter
	SetWatchResourceFilters([]ResourceFilter) error
}

CentralConfig - Interface to get central Config

func NewCentralConfig

func NewCentralConfig(agentType AgentType) CentralConfig

NewCentralConfig - Creates the default central config

func NewTestCentralConfig

func NewTestCentralConfig(agentType AgentType) CentralConfig

NewTestCentralConfig - Creates the default central config

func ParseCentralConfig

func ParseCentralConfig(props properties.Properties, agentType AgentType) (CentralConfig, error)

ParseCentralConfig - Parses the Central Config values from the command line

type CentralConfiguration

type CentralConfiguration struct {
	CentralConfig
	IConfigValidator
	AgentType                 AgentType
	TenantID                  string               `config:"organizationID"`
	TeamName                  string               `config:"team"`
	APICDeployment            string               `config:"deployment"`
	Environment               string               `config:"environment"`
	EnvironmentID             string               `config:"environmentID"`
	AgentName                 string               `config:"agentName"`
	URL                       string               `config:"url"`
	SingleURL                 string               `config:"platformSingleURL"`
	PlatformURL               string               `config:"platformURL"`
	APIServerVersion          string               `config:"apiServerVersion"`
	TagsToPublish             string               `config:"additionalTags"`
	AppendEnvironmentToTitle  bool                 `config:"appendEnvironmentToTitle"`
	MigrationSettings         MigrationConfig      `config:"migration"`
	Auth                      AuthConfig           `config:"auth"`
	TLS                       TLSConfig            `config:"ssl"`
	PollInterval              time.Duration        `config:"pollInterval"`
	ReportActivityFrequency   time.Duration        `config:"reportActivityFrequency"`
	ClientTimeout             time.Duration        `config:"clientTimeout"`
	APIServiceRevisionPattern string               `config:"apiServiceRevisionPattern"`
	ProxyURL                  string               `config:"proxyUrl"`
	SubscriptionConfiguration SubscriptionConfig   `config:"subscriptions"`
	UsageReporting            UsageReportingConfig `config:"usageReporting"`
	GRPCCfg                   GRPCConfig           `config:"grpc"`
	CacheStoragePath          string               `config:"cacheStoragePath"`
	CacheStorageInterval      time.Duration        `config:"cacheStorageInterval"`
	JobExecutionTimeout       time.Duration

	WatchResourceFilters []ResourceFilter
	// contains filtered or unexported fields
}

CentralConfiguration - Structure to hold the central config

func (*CentralConfiguration) DeleteServicesURL

func (c *CentralConfiguration) DeleteServicesURL() string

DeleteServicesURL - Returns the APIServer URL for services API instances

func (*CentralConfiguration) GetAPICDeployment

func (c *CentralConfiguration) GetAPICDeployment() string

GetAPICDeployment - Returns the Central deployment type 'prod', 'preprod', team ('beano')

func (*CentralConfiguration) GetAPIServerAccessRequestDefinitionURL

func (c *CentralConfiguration) GetAPIServerAccessRequestDefinitionURL() string

GetAPIServerAccessRequestDefinitionURL - Returns the APIServer URL for access request definitions

func (*CentralConfiguration) GetAPIServerCatalogURL

func (c *CentralConfiguration) GetAPIServerCatalogURL() string

GetAPIServerCatalogURL - Returns the base path for the API server for catalog resources

func (*CentralConfiguration) GetAPIServerSecretsURL

func (c *CentralConfiguration) GetAPIServerSecretsURL() string

GetAPIServerSecretsURL - Returns the APIServer URL for secrets

func (*CentralConfiguration) GetAPIServerSubscriptionDefinitionURL

func (c *CentralConfiguration) GetAPIServerSubscriptionDefinitionURL() string

GetAPIServerSubscriptionDefinitionURL - Returns the APIServer URL for services API instances

func (*CentralConfiguration) GetAPIServerURL

func (c *CentralConfiguration) GetAPIServerURL() string

GetAPIServerURL - Returns the base path for the API server

func (*CentralConfiguration) GetAPIServerWebhooksURL

func (c *CentralConfiguration) GetAPIServerWebhooksURL() string

GetAPIServerWebhooksURL - Returns the APIServer URL for webhooks instances

func (*CentralConfiguration) GetAPIServiceRevisionPattern

func (c *CentralConfiguration) GetAPIServiceRevisionPattern() string

GetAPIServiceRevisionPattern - Returns the naming pattern for APIServiceRevition title

func (*CentralConfiguration) GetAccessRequestStateURL

func (c *CentralConfiguration) GetAccessRequestStateURL(accessRequestName string) string

GetAccessRequestStateURL - Returns the access request URL to update the state

func (*CentralConfiguration) GetAccessRequestSubscriptionPropertiesURL

func (c *CentralConfiguration) GetAccessRequestSubscriptionPropertiesURL(accessRequestName string) string

GetAccessRequestSubscriptionPropertiesURL - Returns the access request URL for subscription properties

func (*CentralConfiguration) GetAccessRequestURL

func (c *CentralConfiguration) GetAccessRequestURL(accessRequestName string) string

GetAccessRequestURL - Returns the access request URL for catalog item subscription states

func (*CentralConfiguration) GetAccessRequestsURL

func (c *CentralConfiguration) GetAccessRequestsURL() string

GetAccessRequestsURL - Returns the accessrequest URL for access request API

func (*CentralConfiguration) GetAgentName

func (c *CentralConfiguration) GetAgentName() string

GetAgentName - Returns the agent name

func (*CentralConfiguration) GetAgentType

func (c *CentralConfiguration) GetAgentType() AgentType

GetAgentType - Returns the agent type

func (*CentralConfiguration) GetAppendEnvironmentToTitle

func (c *CentralConfiguration) GetAppendEnvironmentToTitle() bool

GetAppendEnvironmentToTitle - Returns the value of append environment name to title attribute

func (*CentralConfiguration) GetAuthConfig

func (c *CentralConfiguration) GetAuthConfig() AuthConfig

GetAuthConfig - Returns the Auth Config

func (*CentralConfiguration) GetCacheStorageInterval

func (c *CentralConfiguration) GetCacheStorageInterval() time.Duration

GetCacheStorageInterval -

func (*CentralConfiguration) GetCacheStoragePath

func (c *CentralConfiguration) GetCacheStoragePath() string

GetCacheStoragePath -

func (*CentralConfiguration) GetCatalogItemByIDURL

func (c *CentralConfiguration) GetCatalogItemByIDURL(catalogItemID string) string

GetCatalogItemByIDURL - Returns URL to get catalog item by id

func (*CentralConfiguration) GetCatalogItemSubscriptionDefinitionPropertiesURL

func (c *CentralConfiguration) GetCatalogItemSubscriptionDefinitionPropertiesURL(catalogItemID string) string

GetCatalogItemSubscriptionDefinitionPropertiesURL - Returns the unifiedcatalog URL for catalog item subscription definition properties

func (*CentralConfiguration) GetCatalogItemSubscriptionPropertiesURL

func (c *CentralConfiguration) GetCatalogItemSubscriptionPropertiesURL(catalogItemID, subscriptionID string) string

GetCatalogItemSubscriptionPropertiesURL - Returns the unifiedcatalog URL for catalog item subscription properties

func (*CentralConfiguration) GetCatalogItemSubscriptionRelationshipURL

func (c *CentralConfiguration) GetCatalogItemSubscriptionRelationshipURL(catalogItemID, subscriptionID string) string

GetCatalogItemSubscriptionRelationshipURL - Returns the relationships URL for catalog item subscription

func (*CentralConfiguration) GetCatalogItemSubscriptionStatesURL

func (c *CentralConfiguration) GetCatalogItemSubscriptionStatesURL(catalogItemID, subscriptionID string) string

GetCatalogItemSubscriptionStatesURL - Returns the unifiedcatalog URL for catalog item subscription states

func (*CentralConfiguration) GetCatalogItemSubscriptionsURL

func (c *CentralConfiguration) GetCatalogItemSubscriptionsURL(catalogItemID string) string

GetCatalogItemSubscriptionsURL - Returns the unifiedcatalog URL for catalog item subscriptions

func (*CentralConfiguration) GetCatalogItemsURL

func (c *CentralConfiguration) GetCatalogItemsURL() string

GetCatalogItemsURL - Returns the unifiedcatalog URL for catalog items API

func (*CentralConfiguration) GetCategoriesURL

func (c *CentralConfiguration) GetCategoriesURL() string

GetCategoriesURL - Returns the Categories URL

func (*CentralConfiguration) GetClientTimeout

func (c *CentralConfiguration) GetClientTimeout() time.Duration

GetClientTimeout - Returns the interval for http client timeouts

func (*CentralConfiguration) GetConsumerInstancesURL

func (c *CentralConfiguration) GetConsumerInstancesURL() string

GetConsumerInstancesURL - Returns the APIServer URL for services API consumer instances

func (*CentralConfiguration) GetEnvironmentACLsURL

func (c *CentralConfiguration) GetEnvironmentACLsURL() string

GetEnvironmentACLsURL - Returns the APIServer URL for ACLs in Environments

func (*CentralConfiguration) GetEnvironmentID

func (c *CentralConfiguration) GetEnvironmentID() string

GetEnvironmentID - Returns the environment ID

func (*CentralConfiguration) GetEnvironmentName

func (c *CentralConfiguration) GetEnvironmentName() string

GetEnvironmentName - Returns the environment name

func (*CentralConfiguration) GetEnvironmentURL

func (c *CentralConfiguration) GetEnvironmentURL() string

GetEnvironmentURL - Returns the APIServer URL for services API

func (*CentralConfiguration) GetFetchOnStartupPageSize

func (c *CentralConfiguration) GetFetchOnStartupPageSize() int

GetFetchOnStartupPageSize -

func (*CentralConfiguration) GetFetchOnStartupRetention

func (c *CentralConfiguration) GetFetchOnStartupRetention() time.Duration

GetFetchOnStartupRetention -

func (*CentralConfiguration) GetGRPCHost

func (c *CentralConfiguration) GetGRPCHost() string

GetGRPCHost -

func (*CentralConfiguration) GetGRPCPort

func (c *CentralConfiguration) GetGRPCPort() int

GetGRPCPort -

func (*CentralConfiguration) GetInstancesURL

func (c *CentralConfiguration) GetInstancesURL() string

GetInstancesURL - Returns the APIServer URL for services API instances

func (*CentralConfiguration) GetJobExecutionTimeout

func (c *CentralConfiguration) GetJobExecutionTimeout() time.Duration

GetJobExecutionTimeout - Returns the max time a job execution can run before considered failed

func (*CentralConfiguration) GetMigrationSettings

func (c *CentralConfiguration) GetMigrationSettings() MigrationConfig

GetMigrationSettings - Returns the Migration Config

func (*CentralConfiguration) GetPlatformURL

func (c *CentralConfiguration) GetPlatformURL() string

GetPlatformURL - Returns the central base URL

func (*CentralConfiguration) GetPollInterval

func (c *CentralConfiguration) GetPollInterval() time.Duration

GetPollInterval - Returns the interval for polling subscriptions

func (*CentralConfiguration) GetProxyURL

func (c *CentralConfiguration) GetProxyURL() string

GetProxyURL - Returns the central Proxy URL

func (*CentralConfiguration) GetReportActivityFrequency

func (c *CentralConfiguration) GetReportActivityFrequency() time.Duration

GetReportActivityFrequency - Returns the interval between running periodic status updater

func (*CentralConfiguration) GetRevisionsURL

func (c *CentralConfiguration) GetRevisionsURL() string

GetRevisionsURL - Returns the APIServer URL for services API revisions

func (*CentralConfiguration) GetServicesURL

func (c *CentralConfiguration) GetServicesURL() string

GetServicesURL - Returns the APIServer URL for services API

func (*CentralConfiguration) GetSingleURL

func (c *CentralConfiguration) GetSingleURL() string

GetSingleURL - Returns the Alternate base URL

func (*CentralConfiguration) GetSubscriptionConfig

func (c *CentralConfiguration) GetSubscriptionConfig() SubscriptionConfig

GetSubscriptionConfig - Returns the Config for the subscription webhook

func (*CentralConfiguration) GetSubscriptionURL

func (c *CentralConfiguration) GetSubscriptionURL() string

GetSubscriptionURL - Returns the unifiedcatalog URL for subscriptions list

func (*CentralConfiguration) GetTLSConfig

func (c *CentralConfiguration) GetTLSConfig() TLSConfig

GetTLSConfig - Returns the TLS Config

func (*CentralConfiguration) GetTagsToPublish

func (c *CentralConfiguration) GetTagsToPublish() string

GetTagsToPublish - Returns tags to publish

func (*CentralConfiguration) GetTeamID

func (c *CentralConfiguration) GetTeamID() string

GetTeamID - Returns the team ID

func (*CentralConfiguration) GetTeamName

func (c *CentralConfiguration) GetTeamName() string

GetTeamName - Returns the team name

func (*CentralConfiguration) GetTenantID

func (c *CentralConfiguration) GetTenantID() string

GetTenantID - Returns the tenant ID

func (*CentralConfiguration) GetURL

func (c *CentralConfiguration) GetURL() string

GetURL - Returns the central base URL

func (*CentralConfiguration) GetUsageReportingConfig

func (c *CentralConfiguration) GetUsageReportingConfig() UsageReportingConfig

GetUsageReportingConfig -

func (*CentralConfiguration) GetWatchResourceFilters

func (c *CentralConfiguration) GetWatchResourceFilters() []ResourceFilter

GetWatchResourceFilters - returns the custom watch filter config

func (*CentralConfiguration) IsAxwayManaged

func (c *CentralConfiguration) IsAxwayManaged() bool

IsAxwayManaged - Returns the environment ID

func (*CentralConfiguration) IsFetchOnStartupEnabled

func (c *CentralConfiguration) IsFetchOnStartupEnabled() bool

IsFetchOnStartupEnabled -

func (*CentralConfiguration) IsGRPCInsecure

func (c *CentralConfiguration) IsGRPCInsecure() bool

IsGRPCInsecure -

func (*CentralConfiguration) IsMarketplaceSubsEnabled

func (c *CentralConfiguration) IsMarketplaceSubsEnabled() bool

IsMarketplaceSubsEnabled - Returns the isMarketplaceSubs boolean

func (*CentralConfiguration) IsUsingGRPC

func (c *CentralConfiguration) IsUsingGRPC() bool

IsUsingGRPC -

func (*CentralConfiguration) SetAxwayManaged

func (c *CentralConfiguration) SetAxwayManaged(isManaged bool)

SetAxwayManaged - Sets the environment ID

func (*CentralConfiguration) SetEnvironmentID

func (c *CentralConfiguration) SetEnvironmentID(environmentID string)

SetEnvironmentID - Sets the environment ID

func (*CentralConfiguration) SetIsMarketplaceSubsEnabled

func (c *CentralConfiguration) SetIsMarketplaceSubsEnabled(enabled bool)

SetIsMarketplaceSubsEnabled - Sets the isMarketplaceSubs boolean

func (*CentralConfiguration) SetTeamID

func (c *CentralConfiguration) SetTeamID(teamID string)

SetTeamID - Sets the team ID

func (*CentralConfiguration) SetWatchResourceFilters

func (c *CentralConfiguration) SetWatchResourceFilters(filters []ResourceFilter) error

SetWatchResourceFilters - sets the custom watch filter config

func (*CentralConfiguration) ValidateCfg

func (c *CentralConfiguration) ValidateCfg() (err error)

ValidateCfg - Validates the config, implementing IConfigInterface

type EmailTemplate

type EmailTemplate struct {
	Subject string `config:"subject"`
	Body    string `config:"body"`
	Oauth   string `config:"oauth"`
	APIKey  string `config:"apikeys"`
}

EmailTemplate -

type ExternalIDPConfig

type ExternalIDPConfig interface {
	GetIDPList() []IDPConfig
	ValidateCfg() (err error)
}

ExternalIDPConfig -

type ExtraProperties

type ExtraProperties map[string]string

ExtraProperties - type for representing extra IdP provider properties to be included in client request

func (*ExtraProperties) UnmarshalJSON

func (e *ExtraProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON - deserializes extra properties from env config

type FetchOnStartup

type FetchOnStartup struct {
	Enabled   bool          `config:"enabled"`
	PageSize  int           `config:"pageSize"`
	Retention time.Duration `config:"retention"`
}

FetchOnStartup - Fetch on startup config

type GRPCConfig

type GRPCConfig struct {
	Enabled        bool           `config:"enabled"`
	Host           string         `config:"host"`
	Port           int            `config:"port"`
	Insecure       bool           `config:"insecure"`
	FetchOnStartup FetchOnStartup `config:"fetchOnStartup"`
}

GRPCConfig - Represents the grpc config

type IConfigValidator

type IConfigValidator interface {
	ValidateCfg() error
}

IConfigValidator - Interface to be implemented for config validation by agent

type IDPAuthConfig

type IDPAuthConfig interface {
	// GetType - type of authentication mechanism to use "accessToken" or "client"
	GetType() string
	// GetAccessToken - token(initial access token/Admin API Token etc) to be used by Agent SDK to authenticate with IdP
	GetAccessToken() string
	// GetClientID - Identifier of the client in IdP that can used to create new OAuth clients
	GetClientID() string
	// GetClientSecret - Secret for the client in IdP that can used to create new OAuth clients
	GetClientSecret() string
	// contains filtered or unexported methods
}

IDPAuthConfig - interface for IdP provider auth config

type IDPAuthConfiguration

type IDPAuthConfiguration struct {
	Type         string   `json:"type,omitempty"`
	AccessToken  string   `json:"accessToken,omitempty"`
	ClientID     string   `json:"clientId,omitempty"`
	ClientSecret string   `json:"clientSecret,omitempty"`
	ClientScopes []string `json:"clientScopes,omitempty"`
}

IDPAuthConfiguration - Structure to hold the IdP provider auth config

func (*IDPAuthConfiguration) GetAccessToken

func (i *IDPAuthConfiguration) GetAccessToken() string

GetAccessToken - token(initial access token/Admin API Token etc) to be used by Agent SDK to authenticate with IdP

func (*IDPAuthConfiguration) GetClientID

func (i *IDPAuthConfiguration) GetClientID() string

GetClientID - Identifier of the client in IdP that can used to create new OAuth client

func (*IDPAuthConfiguration) GetClientSecret

func (i *IDPAuthConfiguration) GetClientSecret() string

GetClientSecret - Secret for the client in IdP that can used to create new OAuth clients

func (*IDPAuthConfiguration) GetType

func (i *IDPAuthConfiguration) GetType() string

GetType - type of authentication mechanism to use "accessToken" or "client"

type IDPConfig

type IDPConfig interface {
	// GetMetadataURL - URL exposed by OAuth authorization server to provide metadata information
	GetMetadataURL() string
	// GetIDPType - IDP type ("generic" or "okta")
	GetIDPType() string
	// GetIDPName - for the identity provider
	GetIDPName() string
	// GetAuthConfig - to be used for authentication with IDP
	GetAuthConfig() IDPAuthConfig
	// GetClientScopes - default list of scopes that are included in the client metadata request to IDP
	GetClientScopes() string
	// GetGrantType - default grant type to be used when creating the client. (default :  "client_credentials")
	GetGrantType() string
	// GetAuthMethod - default token endpoint authentication method(default : "client_secret_basic")
	GetAuthMethod() string
	// GetAuthResponseType - default token response type to be used when registering the client
	GetAuthResponseType() string
	// GetExtraProperties - set of additional properties to be applied when registering the client
	GetExtraProperties() map[string]string
	// contains filtered or unexported methods
}

IDPConfig - interface for IdP provider config

type IDPConfiguration

type IDPConfiguration struct {
	Name             string          `json:"name,omitempty"`
	Type             string          `json:"type,omitempty"`
	MetadataURL      string          `json:"metadataUrl,omitempty"`
	AuthConfig       IDPAuthConfig   `json:"auth,omitempty"`
	ClientScopes     string          `json:"scope,omitempty"`
	GrantType        string          `json:"grantType,omitempty"`
	AuthMethod       string          `json:"authMethod,omitempty"`
	AuthResponseType string          `json:"authResponseType,omitempty"`
	ExtraProperties  ExtraProperties `json:"extraProperties,omitempty"`
}

IDPConfiguration - Structure to hold the IdP provider config

func (*IDPConfiguration) GetAuthConfig

func (i *IDPConfiguration) GetAuthConfig() IDPAuthConfig

GetAuthConfig - to be used for authentication with IDP

func (*IDPConfiguration) GetAuthMethod

func (i *IDPConfiguration) GetAuthMethod() string

GetAuthMethod - default token endpoint authentication method(default : "client_secret_basic")

func (*IDPConfiguration) GetAuthResponseType

func (i *IDPConfiguration) GetAuthResponseType() string

GetAuthResponseType - default token response type to be used when registering the client

func (*IDPConfiguration) GetClientScopes

func (i *IDPConfiguration) GetClientScopes() string

GetClientScopes - default list of scopes that are included in the client metadata request to IDP

func (*IDPConfiguration) GetExtraProperties

func (i *IDPConfiguration) GetExtraProperties() map[string]string

GetExtraProperties - set of additional properties to be applied when registering the client

func (*IDPConfiguration) GetGrantType

func (i *IDPConfiguration) GetGrantType() string

GetGrantType - default grant type to be used when creating the client. (default : "client_credentials")

func (*IDPConfiguration) GetIDPName

func (i *IDPConfiguration) GetIDPName() string

GetIDPName - for the identity provider

func (*IDPConfiguration) GetIDPType

func (i *IDPConfiguration) GetIDPType() string

GetIDPType - IDP type ("generic" or "okta")

func (*IDPConfiguration) GetMetadataURL

func (i *IDPConfiguration) GetMetadataURL() string

GetMetadataURL - URL exposed by OAuth authorization server to provide metadata information

type IResourceConfigCallback

type IResourceConfigCallback interface {
	ApplyResources(agentResource *v1.ResourceInstance) error
}

IResourceConfigCallback - Interface to be implemented by configs to apply API Server resource for agent

type LogConfig

type LogConfig interface {
	SetLevel(level string)
}

LogConfig - Interface for logging config

func ParseAndSetupLogConfig

func ParseAndSetupLogConfig(props properties.Properties) (LogConfig, error)

ParseAndSetupLogConfig - Parses the Log Config and setups the logger

type LogConfiguration

type LogConfiguration struct {
	LogConfig
	Level        string               `config:"level"`
	Format       string               `config:"format"`
	Output       string               `config:"output"`
	File         LogFileConfiguration `config:"file"`
	MaskedValues string               `config:"maskedvalues"`
}

LogConfiguration -

type LogFileConfiguration

type LogFileConfiguration struct {
	Name       string `config:"name"`
	Path       string `config:"path"`
	MaxSize    int    `config:"rotateeverybytes"`
	MaxAge     int    `config:"cleanbackups"`
	MaxBackups int    `config:"keepfiles"`
}

LogFileConfiguration - setup the logging configuration for file output

type MigrationConfig

type MigrationConfig interface {
	ShouldCleanInstances() bool
	// contains filtered or unexported methods
}

MigrationConfig - Interface for migration settings config

func ParseMigrationConfig

func ParseMigrationConfig(props properties.Properties) MigrationConfig

ParseMigrationConfig - Parses the Migration Config values from the command line

type MigrationSettings

type MigrationSettings struct {
	CleanInstances bool
}

MigrationSettings -

func (*MigrationSettings) ShouldCleanInstances

func (m *MigrationSettings) ShouldCleanInstances() bool

ShouldCleanInstances - returns the value fo CleanInstances

type NotificationConfig

type NotificationConfig struct {
	SMTP    *smtp         `config:"smtp"`
	Webhook WebhookConfig `config:"webhook"`
}

NotificationConfig -

type NotificationType

type NotificationType string

NotificationType - Type definition for subscription state

type ResourceEventType

type ResourceEventType string

ResourceEventType - watch filter event types

const (
	ResourceEventCreated ResourceEventType = "created"
	ResourceEventUpdated ResourceEventType = "updated"
	ResourceEventDeleted ResourceEventType = "deleted"
)

Resource event types

type ResourceFilter

type ResourceFilter struct {
	Group            string              `json:"group"` // remove group ? and default to management or allow filter for other groups as well?
	Kind             string              `json:"kind"`
	Name             string              `json:"name"`
	EventTypes       []ResourceEventType `json:"eventTypes"`
	Scope            *ResourceScope      `json:"scope"`
	IsCachedResource bool                `json:"isCachedResource"`
}

ResourceFilter - custom watch filter

type ResourceScope

type ResourceScope struct {
	Kind string `json:"kind"`
	Name string `json:"name"`
}

ResourceScope - scope config for watch resource filter

type SMTPAuthType

type SMTPAuthType string

SMTPAuthType - the type of authentication methods the SMTP client supports

type StatusConfig

type StatusConfig interface {
	GetPort() int
	GetHealthCheckPeriod() time.Duration
	GetHealthCheckInterval() time.Duration
	ValidateCfg() error
}

StatusConfig - Interface for status config

func NewStatusConfig

func NewStatusConfig() StatusConfig

NewStatusConfig - create a new status config

func ParseStatusConfig

func ParseStatusConfig(props properties.Properties) (StatusConfig, error)

ParseStatusConfig - Parses the Status Config values form teh command line

type StatusConfiguration

type StatusConfiguration struct {
	StatusConfig
	Port                int           `config:"port"`
	HealthCheckPeriod   time.Duration `config:"healthCheckPeriod"`
	HealthCheckInterval time.Duration `config:"healthCheckInterval"` // this for binary agents only
}

StatusConfiguration -

func (*StatusConfiguration) GetHealthCheckInterval

func (a *StatusConfiguration) GetHealthCheckInterval() time.Duration

GetHealthCheckInterval - Returns the interval between running periodic health checks (binary agents only)

func (*StatusConfiguration) GetHealthCheckPeriod

func (a *StatusConfiguration) GetHealthCheckPeriod() time.Duration

GetHealthCheckPeriod - Returns the timeout before exiting discovery agent

func (*StatusConfiguration) GetPort

func (a *StatusConfiguration) GetPort() int

GetPort - Returns the status port

func (*StatusConfiguration) ValidateCfg

func (a *StatusConfiguration) ValidateCfg() error

ValidateCfg - Validates the config, implementing IConfigInterface

type SubscriptionConfig

type SubscriptionConfig interface {
	PollingEnabled() bool
	GetNotificationTypes() []NotificationType
	GetWebhookURL() string
	GetWebhookHeaders() map[string]string
	GetSMTPURL() string
	GetSMTPHost() string
	GetSMTPFromAddress() string
	GetSMTPAuthType() SMTPAuthType
	GetSMTPIdentity() string
	GetSMTPUsername() string
	GetSMTPPassword() string
	GetSubscribeTemplate() *EmailTemplate
	GetUnsubscribeTemplate() *EmailTemplate
	GetSubscribeFailedTemplate() *EmailTemplate
	GetUnsubscribeFailedTemplate() *EmailTemplate
	GetSubscriptionApprovalMode() string
	GetSubscriptionApprovalWebhookConfig() WebhookConfig
}

SubscriptionConfig - Interface to get subscription config

func NewSubscriptionConfig

func NewSubscriptionConfig() SubscriptionConfig

NewSubscriptionConfig - Creates the default subscription config

func ParseSubscriptionConfig

func ParseSubscriptionConfig(props properties.Properties) SubscriptionConfig

ParseSubscriptionConfig -

type SubscriptionConfiguration

type SubscriptionConfiguration struct {
	SubscriptionConfig
	IConfigValidator
	DisablePolling bool                `config:"disablePolling"`
	Approval       *ApprovalConfig     `config:"approval"`
	Notifications  *NotificationConfig `config:"notifications"`
	Types          []NotificationType
}

SubscriptionConfiguration - Structure to hold the subscription config

func (*SubscriptionConfiguration) GetNotificationTypes

func (s *SubscriptionConfiguration) GetNotificationTypes() []NotificationType

GetNotificationTypes -

func (*SubscriptionConfiguration) GetSMTPAuthType

func (s *SubscriptionConfiguration) GetSMTPAuthType() SMTPAuthType

GetSMTPAuthType -

func (*SubscriptionConfiguration) GetSMTPFromAddress

func (s *SubscriptionConfiguration) GetSMTPFromAddress() string

GetSMTPFromAddress -

func (*SubscriptionConfiguration) GetSMTPHost

func (s *SubscriptionConfiguration) GetSMTPHost() string

GetSMTPHost - Returns the Host for the SMTP server

func (*SubscriptionConfiguration) GetSMTPIdentity

func (s *SubscriptionConfiguration) GetSMTPIdentity() string

GetSMTPIdentity -

func (*SubscriptionConfiguration) GetSMTPPassword

func (s *SubscriptionConfiguration) GetSMTPPassword() string

GetSMTPPassword -

func (*SubscriptionConfiguration) GetSMTPURL

func (s *SubscriptionConfiguration) GetSMTPURL() string

GetSMTPURL - Returns the URL for the SMTP server

func (*SubscriptionConfiguration) GetSMTPUsername

func (s *SubscriptionConfiguration) GetSMTPUsername() string

GetSMTPUsername -

func (*SubscriptionConfiguration) GetSubscribeFailedTemplate

func (s *SubscriptionConfiguration) GetSubscribeFailedTemplate() *EmailTemplate

GetSubscribeFailedTemplate - returns the email template info for a subscribe

func (*SubscriptionConfiguration) GetSubscribeTemplate

func (s *SubscriptionConfiguration) GetSubscribeTemplate() *EmailTemplate

GetSubscribeTemplate - returns the email template info for a subscribe

func (*SubscriptionConfiguration) GetSubscriptionApprovalMode

func (s *SubscriptionConfiguration) GetSubscriptionApprovalMode() string

GetSubscriptionApprovalMode - Returns the subscription approval mode

func (*SubscriptionConfiguration) GetSubscriptionApprovalWebhookConfig

func (s *SubscriptionConfiguration) GetSubscriptionApprovalWebhookConfig() WebhookConfig

GetSubscriptionApprovalWebhookConfig - Returns the Config for the subscription webhook

func (*SubscriptionConfiguration) GetUnsubscribeFailedTemplate

func (s *SubscriptionConfiguration) GetUnsubscribeFailedTemplate() *EmailTemplate

GetUnsubscribeFailedTemplate - returns the email template info for an unsubscribe

func (*SubscriptionConfiguration) GetUnsubscribeTemplate

func (s *SubscriptionConfiguration) GetUnsubscribeTemplate() *EmailTemplate

GetUnsubscribeTemplate - returns the email template info for an unsubscribe

func (*SubscriptionConfiguration) GetWebhookHeaders

func (s *SubscriptionConfiguration) GetWebhookHeaders() map[string]string

GetWebhookHeaders - Returns the notification headers

func (*SubscriptionConfiguration) GetWebhookURL

func (s *SubscriptionConfiguration) GetWebhookURL() string

GetWebhookURL - Returns the webhook url for notifications

func (*SubscriptionConfiguration) PollingEnabled

func (s *SubscriptionConfiguration) PollingEnabled() bool

PollingEnabled - return true when the polling of subscriptsion should be ran on this agent

func (*SubscriptionConfiguration) SetNotificationType

func (s *SubscriptionConfiguration) SetNotificationType(notificationType NotificationType)

SetNotificationType -

func (*SubscriptionConfiguration) ValidateCfg

func (s *SubscriptionConfiguration) ValidateCfg() error

ValidateCfg - Validates the config, implementing IConfigInterface

type TLSCipherSuite

type TLSCipherSuite uint16

TLSCipherSuite - defined type

func NewCipherArray

func NewCipherArray(ciphers []string) []TLSCipherSuite

NewCipherArray - create an array of TLSCipherSuite

func (*TLSCipherSuite) String

func (cs *TLSCipherSuite) String() string

func (*TLSCipherSuite) Unpack

func (cs *TLSCipherSuite) Unpack(s string) error

Unpack - transforms the string into a constant.

type TLSConfig

type TLSConfig interface {
	GetNextProtos() []string
	IsInsecureSkipVerify() bool
	GetCipherSuites() []TLSCipherSuite
	GetMinVersion() TLSVersion
	GetMaxVersion() TLSVersion
	BuildTLSConfig() *tls.Config
}

TLSConfig - interface

func NewTLSConfig

func NewTLSConfig() TLSConfig

NewTLSConfig - build default config

type TLSConfiguration

type TLSConfiguration struct {
	IConfigValidator
	// NextProtos is a list of supported application level protocols, in order of preference.
	NextProtos []string `config:"nextProtos,replace"`

	// InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
	// If InsecureSkipVerify is true, TLS accepts any certificate presented by the server and any host
	// name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks.
	// This should be used only for testing.
	InsecureSkipVerify bool `config:"insecureSkipVerify"`

	// CipherSuites is a list of supported cipher suites for TLS versions up to TLS 1.2. If CipherSuites
	// is nil, a default list of secure cipher suites is used, with a preference order based on hardware
	// performance. The default cipher suites might change over Go versions. Note that TLS 1.3
	// ciphersuites are not configurable.
	CipherSuites []TLSCipherSuite `config:"cipherSuites,replace"`

	// MinVersion contains the minimum SSL/TLS version that is acceptable. If zero, then TLS 1.0 is taken as the minimum.
	MinVersion TLSVersion `config:"minVersion"`

	// MaxVersion contains the maximum SSL/TLS version that is acceptable. If zero, then the maximum
	// version supported by this package is used, which is currently TLS 1.3.
	MaxVersion TLSVersion `config:"maxVersion"`
}

TLSConfiguration - A Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified. A Config may be reused; the tls package will also not modify it.

func (*TLSConfiguration) BuildTLSConfig

func (c *TLSConfiguration) BuildTLSConfig() *tls.Config

BuildTLSConfig takes the TLSConfiguration and transforms it into a `tls.Config`.

func (*TLSConfiguration) GetCipherSuites

func (c *TLSConfiguration) GetCipherSuites() []TLSCipherSuite

GetCipherSuites -

func (*TLSConfiguration) GetMaxVersion

func (c *TLSConfiguration) GetMaxVersion() TLSVersion

GetMaxVersion -

func (*TLSConfiguration) GetMinVersion

func (c *TLSConfiguration) GetMinVersion() TLSVersion

GetMinVersion -

func (*TLSConfiguration) GetNextProtos

func (c *TLSConfiguration) GetNextProtos() []string

GetNextProtos -

func (*TLSConfiguration) IsInsecureSkipVerify

func (c *TLSConfiguration) IsInsecureSkipVerify() bool

IsInsecureSkipVerify -

func (*TLSConfiguration) LoadFrom

func (c *TLSConfiguration) LoadFrom(tlsCfg *tls.Config)

LoadFrom takes the `tls.Config` and transforms it into a TLSConfiguration.

func (*TLSConfiguration) ValidateCfg

func (c *TLSConfiguration) ValidateCfg() (err error)

ValidateCfg - Validates the config, implementing IConfigInterface

type TLSVersion

type TLSVersion uint16

TLSVersion - define type for version

var TLSDefaultMinVersion TLSVersion = tls.VersionTLS12

TLSDefaultMinVersion - get the default min version

func TLSVersionAsValue

func TLSVersionAsValue(cs string) TLSVersion

TLSVersionAsValue - get the version value

func (*TLSVersion) Unpack

func (v *TLSVersion) Unpack(s string) error

Unpack transforms the string into a constant.

type UsageReportingConfig

type UsageReportingConfig interface {
	GetURL() string
	CanPublishUsage() bool
	CanPublishMetric() bool
	GetInterval() time.Duration
	IsOfflineMode() bool
	GetSchedule() string
	GetReportSchedule() string
	GetReportGranularity() int
	UsingQAVars() bool
	Validate()
}

UsageReportingConfig - Interface to get usage reporting config

func NewUsageReporting

func NewUsageReporting() UsageReportingConfig

NewUsageReporting - Creates the default usage reporting config

func ParseUsageReportingConfig

func ParseUsageReportingConfig(props properties.Properties) UsageReportingConfig

ParseUsageReportingConfig - Parses the Usage Reporting Config values from the command line

type UsageReportingConfiguration

type UsageReportingConfiguration struct {
	UsageReportingConfig
	URL           string        `config:"url"`
	Publish       bool          `config:"publish"`
	PublishMetric bool          `config:"publishMetric"`
	Interval      time.Duration `config:"interval"`
	Offline       bool          `config:"offline"`
	Schedule      string        `config:"offlineSchedule"`
	// contains filtered or unexported fields
}

UsageReportingConfiguration - structure to hold all usage reporting settings

func (*UsageReportingConfiguration) CanPublishMetric

func (u *UsageReportingConfiguration) CanPublishMetric() bool

CanPublishMetric - Returns the publish metric boolean

func (*UsageReportingConfiguration) CanPublishUsage

func (u *UsageReportingConfiguration) CanPublishUsage() bool

CanPublishUsage - Returns the publish boolean

func (*UsageReportingConfiguration) GetInterval

func (u *UsageReportingConfiguration) GetInterval() time.Duration

GetInterval - Returns the publish interval

func (*UsageReportingConfiguration) GetReportGranularity

func (u *UsageReportingConfiguration) GetReportGranularity() int

GetReportGranularity - Returns the granularity used in the offline reports

func (*UsageReportingConfiguration) GetReportSchedule

func (u *UsageReportingConfiguration) GetReportSchedule() string

GetReportSchedule - Returns the offline schedule string for creating reports

func (*UsageReportingConfiguration) GetSchedule

func (u *UsageReportingConfiguration) GetSchedule() string

GetSchedule - Returns the schedule string

func (*UsageReportingConfiguration) GetURL

func (u *UsageReportingConfiguration) GetURL() string

GetURL - Returns the usage reporting URL

func (*UsageReportingConfiguration) IsOfflineMode

func (u *UsageReportingConfiguration) IsOfflineMode() bool

IsOfflineMode - Returns the offline boolean

func (*UsageReportingConfiguration) UsingQAVars

func (u *UsageReportingConfiguration) UsingQAVars() bool

UsingQAVars - Returns the offline boolean

func (*UsageReportingConfiguration) Validate

func (u *UsageReportingConfiguration) Validate()

Validate -

type WebhookConfig

type WebhookConfig interface {
	GetURL() string
	GetWebhookHeaders() map[string]string
	GetSecret() string
	IsConfigured() bool
	ValidateConfig() error
}

WebhookConfig - Interface for webhook config

func NewWebhookConfig

func NewWebhookConfig() WebhookConfig

NewWebhookConfig -

type WebhookConfiguration

type WebhookConfiguration struct {
	WebhookConfig
	URL     string `config:"url"`
	Headers string `config:"headers"`
	Secret  string `config:"secret"`
	// contains filtered or unexported fields
}

WebhookConfiguration - do NOT make this an IConfigValidator, as it is validated as part of subscriptionConfig

func (*WebhookConfiguration) GetSecret

func (c *WebhookConfiguration) GetSecret() string

GetSecret - Returns the secret

func (*WebhookConfiguration) GetURL

func (c *WebhookConfiguration) GetURL() string

GetURL - Returns the URL

func (*WebhookConfiguration) GetWebhookHeaders

func (c *WebhookConfiguration) GetWebhookHeaders() map[string]string

GetWebhookHeaders - Returns the webhook headers

func (*WebhookConfiguration) IsConfigured

func (c *WebhookConfiguration) IsConfigured() bool

IsConfigured - bool

func (*WebhookConfiguration) ValidateConfig

func (c *WebhookConfiguration) ValidateConfig() error

ValidateConfig - Validate the config. Do NOT make this ValidateCfg IConfigValidator. It is called directly from the subscriptionconfig validator. But, it is ONLY called if the approvalMode is "webhook"

Jump to

Keyboard shortcuts

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