Documentation ¶
Index ¶
- Constants
- Variables
- func AddUpdateAgentDetails(key, value string)
- func ApplyResourceToConfig(cfg interface{}) error
- func GetAPICache() cache.Cache
- func GetAgentResource() *apiV1.ResourceInstance
- 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 GetTeamByID(id string) *definitions.PlatformTeam
- func GetTeamByName(name string) *definitions.PlatformTeam
- func Initialize(centralCfg config.CentralConfig) error
- func InitializeForTest(apicClient apic.Client)
- 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 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 RegisterAPIValidator(apiValidator APIValidator)
- func RegisterDeleteServiceValidator(validator interface{})
- func RegisterProvisioner(provisioner provisioning.Provisioning)
- func RegisterResourceEventHandler(name string, resourceEventHandler handler.Handler)
- func RemovePublishedAPIAgentDetail(externalAPIID, detailKey string) error
- func StartAgentStatusUpdate()
- 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 WithCRDForIDP(p oauth.Provider, scopes []string) 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 WithCRDRequestSchemaProperty(prop provisioning.PropertyBuilder) func(c *crdBuilderOptions)
- type APIValidator
- type ConfigChangeHandler
- type EventSync
- type PublishAPIFunc
Constants ¶
const ( AgentRunning = "running" AgentStopped = "stopped" AgentFailed = "failed" AgentUnhealthy = "unhealthy" )
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 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 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 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 NewCredentialRequestBuilder ¶
func NewCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder
NewCredentialRequestBuilder - called by the agents to build and register a new credential reqest 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 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 RemovePublishedAPIAgentDetail ¶
RemovePublishedAPIAgentDetail -
func StartAgentStatusUpdate ¶
func StartAgentStatusUpdate()
StartAgentStatusUpdate - starts 2 separate jobs that runs the periodic status updates and immediate status updates
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 WithCRDForIDP ¶
WithCRDForIDP - set the schema properties using the provider metadata
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 WithCRDRequestSchemaProperty ¶
func WithCRDRequestSchemaProperty(prop provisioning.PropertyBuilder) func(c *crdBuilderOptions)
WithCRDRequestSchemaProperty - add more request properties
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
type PublishAPIFunc ¶
type PublishAPIFunc func(serviceBody apic.ServiceBody) error
PublishAPIFunc definition for the PublishAPI func