Documentation ¶
Index ¶
- Constants
- Variables
- func AddUpdateAgentDetails(key, value string)
- func ApplyResourceToConfig(cfg interface{}) error
- func GetAPICache() cache.Cache
- func GetAgentResource() *apiV1.ResourceInstance
- func GetAgentResourceManager() resource.Manager
- func GetAttributeOnPublishedAPI(externalAPIID string, attrName string) string
- func GetAttributeOnPublishedAPIByID(externalAPIID string, attrName string) string
- func GetAttributeOnPublishedAPIByName(apiName string, attrName string) string
- func GetAttributeOnPublishedAPIByPrimaryKey(primaryKey string, attrName string) string
- func GetAuthProviderRegistry() oauth.ProviderRegistry
- func GetCacheManager() agentcache.Manager
- func GetCentralAuthToken() (string, error)
- func GetCentralClient() apic.Client
- func GetCentralConfig() config.CentralConfig
- func GetDetailFromAgentResource(key string) string
- func GetOwnerOnPublishedAPIByID(externalAPIID string) *apiV1.Owner
- func GetOwnerOnPublishedAPIByName(apiName string) *apiV1.Owner
- func GetOwnerOnPublishedAPIByPrimaryKey(primaryKey string) *apiV1.Owner
- func GetResourceManager() resource.Manager
- func GetStatus() string
- func GetTeamByID(id string) *definitions.PlatformTeam
- func GetTeamByName(name string) *definitions.PlatformTeam
- func GetUserAgent() string
- func Initialize(centralCfg config.CentralConfig) error
- func InitializeForTest(apicClient apic.Client, opts ...TestOpt)
- func InitializeProfiling(cpuProfile, memProfile string)
- func InitializeWithAgentFeatures(centralCfg config.CentralConfig, agentFeaturesCfg config.AgentFeaturesConfig) error
- func IsAPIPublished(externalAPIID string) bool
- func IsAPIPublishedByID(externalAPIID string) bool
- func IsAPIPublishedByPrimaryKey(primaryKey string) bool
- func NewAPIKeyAccessRequestBuilder() provisioning.AccessRequestBuilder
- func NewAPIKeyCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
- func NewAccessRequestBuilder() provisioning.AccessRequestBuilder
- func NewBasicAuthAccessRequestBuilder() provisioning.AccessRequestBuilder
- func NewBasicAuthCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
- func NewCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
- func NewOAuthCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
- func OnAgentResourceChange(agentResourceChangeHandler ConfigChangeHandler)
- func OnConfigChange(configChangeHandler ConfigChangeHandler)
- func PublishAPI(serviceBody apic.ServiceBody) error
- func PublishingLock()
- func PublishingUnlock()
- func RefreshTeamCache()
- func RegisterAPIValidator(apiValidator APIValidator)
- func RegisterDeleteServiceValidator(validator interface{})
- func RegisterProvisioner(provisioner provisioning.Provisioning)
- func RegisterResourceEventHandler(name string, resourceEventHandler handler.Handler)
- func RegisterShutdownHandler(handler ShutdownHandler)
- func RemovePublishedAPIAgentDetail(externalAPIID, detailKey string) error
- func StartAgentStatusUpdate()
- func TestWithAgentType(agentType config.AgentType) func(*testOpts)
- func TestWithCentralConfig(cfg config.CentralConfig) func(*testOpts)
- func TestWithMarketplace() func(*testOpts)
- func UnregisterResourceEventHandler(name string)
- func UpdateStatus(status, description string)
- func UpdateStatusWithContext(ctx context.Context, status, prevStatus, description string)
- func UpdateStatusWithPrevious(status, prevStatus, description string)
- func WithCRDDeprovisionExpired() func(c *crdBuilderOptions)
- func WithCRDExpirationDays(expirationDays int) func(c *crdBuilderOptions)
- func WithCRDForIDP(p oauth.Provider, scopes []string) func(c *crdBuilderOptions)
- func WithCRDIsRenewable() func(c *crdBuilderOptions)
- func WithCRDIsSuspendable() func(c *crdBuilderOptions)
- func WithCRDName(name string) func(c *crdBuilderOptions)
- func WithCRDOAuthPublicKey() func(c *crdBuilderOptions)
- func WithCRDOAuthSecret() func(c *crdBuilderOptions)
- func WithCRDProvisionSchemaProperty(prop provisioning.PropertyBuilder) func(c *crdBuilderOptions)
- func WithCRDRegisterFunc(registerFunc provisioning.RegisterCredentialRequestDefinition) func(c *crdBuilderOptions)
- func WithCRDRequestSchemaProperty(prop provisioning.PropertyBuilder) func(c *crdBuilderOptions)
- func WithCRDTitle(title string) func(c *crdBuilderOptions)
- type APIValidator
- type ConfigChangeHandler
- type EventSync
- type PublishAPIFunc
- type ShutdownHandler
- type TestOpt
Constants ¶
const ( AgentRunning = "running" AgentStopped = "stopped" AgentFailed = "failed" AgentUnhealthy = "unhealthy" // CorsField - CorsField = "cors" // RedirectURLsField - RedirectURLsField = "redirectURLs" )
AgentStatus - status for Agent resource
Variables ¶
var ( ErrDeletingService = errors.Newf(1161, "error deleting API Service %s in Amplify Central") ErrDeletingServiceInstanceItem = errors.Newf(1162, "error deleting API Service Instance %s in Amplify Central") ErrUnableToGetAPIV1Resources = errors.Newf(1163, "error retrieving API Service resource instances for %s") )
Errors hit when validating Amplify Central connectivity
var AgentResourceType string
AgentResourceType - Holds the type for agent resource in Central
Functions ¶
func AddUpdateAgentDetails ¶
func AddUpdateAgentDetails(key, value string)
AddUpdateAgentDetails - Adds a new or Updates an existing key on the agent details sub resource
func ApplyResourceToConfig ¶
func ApplyResourceToConfig(cfg interface{}) error
ApplyResourceToConfig - applies the resources to agent configs Uses reflection to get the IResourceConfigCallback interface on the config struct or struct variable. Makes call to ApplyResources method with dataplane and agent resources from API server
func GetAgentResource ¶
func GetAgentResource() *apiV1.ResourceInstance
GetAgentResource - Returns Agent resource
func GetAgentResourceManager ¶ added in v1.1.61
GetAgentResourceManager - Returns Agent resource
func GetAttributeOnPublishedAPI ¶
GetAttributeOnPublishedAPI - DEPRECATED Returns the value on published proxy
func GetAttributeOnPublishedAPIByID ¶
GetAttributeOnPublishedAPIByID - Returns the value on published proxy
func GetAttributeOnPublishedAPIByName ¶
GetAttributeOnPublishedAPIByName - Returns the value on published proxy
func GetAttributeOnPublishedAPIByPrimaryKey ¶
GetAttributeOnPublishedAPIByPrimaryKey - Returns the value on published proxy
func GetAuthProviderRegistry ¶
func GetAuthProviderRegistry() oauth.ProviderRegistry
GetAuthProviderRegistry - Returns the auth provider registry
func GetCacheManager ¶
func GetCacheManager() agentcache.Manager
GetCacheManager - Returns the cache
func GetCentralAuthToken ¶
GetCentralAuthToken - Returns the Auth token from AxwayID to make API call to Central
func GetCentralClient ¶
GetCentralClient - Returns the APIC Client
func GetCentralConfig ¶
func GetCentralConfig() config.CentralConfig
GetCentralConfig - Returns the APIC Client
func GetDetailFromAgentResource ¶
GetDetailFromAgentResource - gets the value of an agent detail from the resource
func GetOwnerOnPublishedAPIByID ¶
GetOwnerOnPublishedAPIByID - Returns the owner spec of the published proxy
func GetOwnerOnPublishedAPIByName ¶
GetOwnerOnPublishedAPIByName - Returns the owner spec of the published proxy
func GetOwnerOnPublishedAPIByPrimaryKey ¶
GetOwnerOnPublishedAPIByPrimaryKey - Returns the owner spec of the published proxy
func GetResourceManager ¶ added in v1.1.61
func GetTeamByID ¶
func GetTeamByID(id string) *definitions.PlatformTeam
GetTeamByID - Returns the PlatformTeam associated with the id
func GetTeamByName ¶
func GetTeamByName(name string) *definitions.PlatformTeam
GetTeamByName - Returns the PlatformTeam associated with the name
func GetUserAgent ¶ added in v1.1.96
func GetUserAgent() string
func Initialize ¶
func Initialize(centralCfg config.CentralConfig) error
Initialize - Initializes the agent
func InitializeForTest ¶
InitializeForTest - Initialize for test
func InitializeProfiling ¶
func InitializeProfiling(cpuProfile, memProfile string)
InitializeProfiling - setup the CPU and Memory profiling if options given
func InitializeWithAgentFeatures ¶
func InitializeWithAgentFeatures(centralCfg config.CentralConfig, agentFeaturesCfg config.AgentFeaturesConfig) error
InitializeWithAgentFeatures - Initializes the agent with agent features
func IsAPIPublished ¶
IsAPIPublished - DEPRECATED Returns true if the API Service is already published
func IsAPIPublishedByID ¶
IsAPIPublishedByID - Returns true if the API Service is already published
func IsAPIPublishedByPrimaryKey ¶
IsAPIPublishedByPrimaryKey - Returns true if the API Service is already published
func NewAPIKeyAccessRequestBuilder ¶
func NewAPIKeyAccessRequestBuilder() provisioning.AccessRequestBuilder
NewAPIKeyAccessRequestBuilder - called by the agents
func NewAPIKeyCredentialRequestBuilder ¶
func NewAPIKeyCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
NewAPIKeyCredentialRequestBuilder - add api key base properties for provisioning schema
func NewAccessRequestBuilder ¶
func NewAccessRequestBuilder() provisioning.AccessRequestBuilder
NewAccessRequestBuilder - called by the agents to build and register a new access request definition
func NewBasicAuthAccessRequestBuilder ¶ added in v1.1.40
func NewBasicAuthAccessRequestBuilder() provisioning.AccessRequestBuilder
NewBasicAuthAccessRequestBuilder - called by the agents
func NewBasicAuthCredentialRequestBuilder ¶ added in v1.1.40
func NewBasicAuthCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
NewBasicAuthCredentialRequestBuilder - add basic auth base properties for provisioning schema
func NewCredentialRequestBuilder ¶
func NewCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
NewCredentialRequestBuilder - called by the agents to build and register a new credential request definition
func NewOAuthCredentialRequestBuilder ¶
func NewOAuthCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
NewOAuthCredentialRequestBuilder - add oauth base properties for provisioning schema
func OnAgentResourceChange ¶
func OnAgentResourceChange(agentResourceChangeHandler ConfigChangeHandler)
OnAgentResourceChange - Registers handler for resource change event
func OnConfigChange ¶
func OnConfigChange(configChangeHandler ConfigChangeHandler)
OnConfigChange - Registers handler for config change event
func PublishAPI ¶
func PublishAPI(serviceBody apic.ServiceBody) error
PublishAPI - Publishes the API
func PublishingLock ¶ added in v1.1.42
func PublishingLock()
func PublishingUnlock ¶ added in v1.1.42
func PublishingUnlock()
func RefreshTeamCache ¶ added in v1.1.71
func RefreshTeamCache()
func RegisterAPIValidator ¶
func RegisterAPIValidator(apiValidator APIValidator)
RegisterAPIValidator - Registers callback for validating the API on gateway
func RegisterDeleteServiceValidator ¶
func RegisterDeleteServiceValidator(validator interface{})
RegisterDeleteServiceValidator - DEPRECATED Registers callback for validating if the service should be deleted
func RegisterProvisioner ¶
func RegisterProvisioner(provisioner provisioning.Provisioning)
RegisterProvisioner - allow the agent to register a provisioner
func RegisterResourceEventHandler ¶
RegisterResourceEventHandler - Registers handler for resource events
func RegisterShutdownHandler ¶ added in v1.1.69
func RegisterShutdownHandler(handler ShutdownHandler)
RegisterShutdownHandler - Registers shutdown handler
func RemovePublishedAPIAgentDetail ¶
RemovePublishedAPIAgentDetail -
func StartAgentStatusUpdate ¶
func StartAgentStatusUpdate()
StartAgentStatusUpdate - starts 2 separate jobs that runs the periodic status updates and immediate status updates
func TestWithAgentType ¶ added in v1.1.75
func TestWithCentralConfig ¶ added in v1.1.75
func TestWithCentralConfig(cfg config.CentralConfig) func(*testOpts)
func TestWithMarketplace ¶ added in v1.1.74
func TestWithMarketplace() func(*testOpts)
func UnregisterResourceEventHandler ¶
func UnregisterResourceEventHandler(name string)
UnregisterResourceEventHandler - removes the specified resource event handler
func UpdateStatus ¶
func UpdateStatus(status, description string)
UpdateStatus - Updates the agent state
func UpdateStatusWithContext ¶
UpdateStatusWithContext - Updates the agent state providing a context
func UpdateStatusWithPrevious ¶
func UpdateStatusWithPrevious(status, prevStatus, description string)
UpdateStatusWithPrevious - Updates the agent state providing a previous state
func WithCRDDeprovisionExpired ¶ added in v1.1.91
func WithCRDDeprovisionExpired() func(c *crdBuilderOptions)
WithCRDDeprovisionExpired - set the flag for deprovisioning expired credential
func WithCRDExpirationDays ¶ added in v1.1.91
func WithCRDExpirationDays(expirationDays int) func(c *crdBuilderOptions)
WithCRDExpirationDays - set the expiration days
func WithCRDForIDP ¶
WithCRDForIDP - set the schema properties using the provider metadata
func WithCRDIsRenewable ¶ added in v1.1.35
func WithCRDIsRenewable() func(c *crdBuilderOptions)
WithCRDIsRenewable - set the flag for renewable credential
func WithCRDIsSuspendable ¶ added in v1.1.35
func WithCRDIsSuspendable() func(c *crdBuilderOptions)
WithCRDIsSuspendable - set the flag for suspendable credential
func WithCRDName ¶
func WithCRDName(name string) func(c *crdBuilderOptions)
WithCRDName - set another name for the CRD
func WithCRDOAuthPublicKey ¶
func WithCRDOAuthPublicKey() func(c *crdBuilderOptions)
WithCRDOAuthPublicKey - set that the Oauth cred is key based
func WithCRDOAuthSecret ¶
func WithCRDOAuthSecret() func(c *crdBuilderOptions)
WithCRDOAuthSecret - set that the Oauth cred is secret based
func WithCRDProvisionSchemaProperty ¶
func WithCRDProvisionSchemaProperty(prop provisioning.PropertyBuilder) func(c *crdBuilderOptions)
WithCRDProvisionSchemaProperty - add more provisioning properties
func WithCRDRegisterFunc ¶ added in v1.1.91
func WithCRDRegisterFunc(registerFunc provisioning.RegisterCredentialRequestDefinition) func(c *crdBuilderOptions)
WithCRDRegisterFunc - use the provided registration function for creating CRD
func WithCRDRequestSchemaProperty ¶
func WithCRDRequestSchemaProperty(prop provisioning.PropertyBuilder) func(c *crdBuilderOptions)
WithCRDRequestSchemaProperty - add more request properties
func WithCRDTitle ¶ added in v1.1.35
func WithCRDTitle(title string) func(c *crdBuilderOptions)
WithCRDTitle - set the title for the CRD
Types ¶
type APIValidator ¶
APIValidator - Callback for validating the API
type ConfigChangeHandler ¶
type ConfigChangeHandler func()
ConfigChangeHandler - Callback for Config change event
func GetConfigChangeHandler ¶
func GetConfigChangeHandler() ConfigChangeHandler
GetConfigChangeHandler - returns registered config change handler
type EventSync ¶
type EventSync struct {
// contains filtered or unexported fields
}
EventSync struct for syncing events from central
func (*EventSync) RebuildCache ¶ added in v1.1.61
func (es *EventSync) RebuildCache()
type PublishAPIFunc ¶
type PublishAPIFunc func(serviceBody apic.ServiceBody) error
PublishAPIFunc definition for the PublishAPI func
type ShutdownHandler ¶ added in v1.1.69
type ShutdownHandler func()
ShutdownHandler - function that the agent may implement to be called when a shutdown request is received